add more missing imports and one _()
This commit is contained in:
parent
a60e715138
commit
2a69e927d2
|
@ -30,6 +30,17 @@ import logging
|
|||
# logging has been set up in fpdb.py or HUD_main.py, use their settings:
|
||||
log = logging.getLogger("filter")
|
||||
|
||||
import locale
|
||||
lang=locale.getdefaultlocale()[0][0:2]
|
||||
if lang=="en":
|
||||
def _(string): return string
|
||||
else:
|
||||
import gettext
|
||||
try:
|
||||
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
|
||||
trans.install()
|
||||
except IOError:
|
||||
def _(string): return string
|
||||
|
||||
import Configuration
|
||||
import Database
|
||||
|
|
|
@ -42,6 +42,18 @@ except ImportError, inst:
|
|||
and HUD are NOT affected by this problem.""")
|
||||
print "ImportError: %s" % inst.args
|
||||
|
||||
import locale
|
||||
lang=locale.getdefaultlocale()[0][0:2]
|
||||
if lang=="en":
|
||||
def _(string): return string
|
||||
else:
|
||||
import gettext
|
||||
try:
|
||||
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
|
||||
trans.install()
|
||||
except IOError:
|
||||
def _(string): return string
|
||||
|
||||
import fpdb_import
|
||||
import Database
|
||||
import Filters
|
||||
|
|
|
@ -22,6 +22,18 @@ import gtk
|
|||
from imaplib import IMAP4
|
||||
from socket import gaierror
|
||||
|
||||
import locale
|
||||
lang=locale.getdefaultlocale()[0][0:2]
|
||||
if lang=="en":
|
||||
def _(string): return string
|
||||
else:
|
||||
import gettext
|
||||
try:
|
||||
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
|
||||
trans.install()
|
||||
except IOError:
|
||||
def _(string): return string
|
||||
|
||||
import ImapFetcher
|
||||
|
||||
class GuiImapFetcher (threading.Thread):
|
||||
|
|
|
@ -22,6 +22,18 @@ import gtk
|
|||
import os
|
||||
from time import time, strftime
|
||||
|
||||
import locale
|
||||
lang=locale.getdefaultlocale()[0][0:2]
|
||||
if lang=="en":
|
||||
def _(string): return string
|
||||
else:
|
||||
import gettext
|
||||
try:
|
||||
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
|
||||
trans.install()
|
||||
except IOError:
|
||||
def _(string): return string
|
||||
|
||||
import fpdb_import
|
||||
import Database
|
||||
import Filters
|
||||
|
|
|
@ -41,6 +41,18 @@ except ImportError, inst:
|
|||
print _("""Failed to load numpy and/or matplotlib in Session Viewer""")
|
||||
print _("ImportError: %s") % inst.args
|
||||
|
||||
import locale
|
||||
lang=locale.getdefaultlocale()[0][0:2]
|
||||
if lang=="en":
|
||||
def _(string): return string
|
||||
else:
|
||||
import gettext
|
||||
try:
|
||||
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
|
||||
trans.install()
|
||||
except IOError:
|
||||
def _(string): return string
|
||||
|
||||
import Card
|
||||
import fpdb_import
|
||||
import Database
|
||||
|
|
|
@ -24,6 +24,18 @@ import gtk
|
|||
#import sys
|
||||
from time import time, strftime
|
||||
|
||||
import locale
|
||||
lang=locale.getdefaultlocale()[0][0:2]
|
||||
if lang=="en":
|
||||
def _(string): return string
|
||||
else:
|
||||
import gettext
|
||||
try:
|
||||
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
|
||||
trans.install()
|
||||
except IOError:
|
||||
def _(string): return string
|
||||
|
||||
#import Card
|
||||
#import fpdb_import
|
||||
#import Database
|
||||
|
|
|
@ -20,6 +20,18 @@ import pygtk
|
|||
pygtk.require('2.0')
|
||||
import gtk
|
||||
|
||||
import locale
|
||||
lang=locale.getdefaultlocale()[0][0:2]
|
||||
if lang=="en":
|
||||
def _(string): return string
|
||||
else:
|
||||
import gettext
|
||||
try:
|
||||
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
|
||||
trans.install()
|
||||
except IOError:
|
||||
def _(string): return string
|
||||
|
||||
class GuiTourneyViewer (threading.Thread):
|
||||
def __init__(self, config, db, sql, mainwin, debug=True):
|
||||
self.db = db
|
||||
|
|
|
@ -29,6 +29,17 @@ from time import gmtime, mktime, strftime, strptime
|
|||
import logging #logging has been set up in fpdb.py or HUD_main.py, use their settings:
|
||||
log = logging.getLogger("filter")
|
||||
|
||||
import locale
|
||||
lang=locale.getdefaultlocale()[0][0:2]
|
||||
if lang=="en":
|
||||
def _(string): return string
|
||||
else:
|
||||
import gettext
|
||||
try:
|
||||
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
|
||||
trans.install()
|
||||
except IOError:
|
||||
def _(string): return string
|
||||
|
||||
#import Configuration
|
||||
#import Database
|
||||
|
@ -74,7 +85,7 @@ class TourneyFilters(Filters.Filters):
|
|||
self.numTourneys = int(w.get_text())
|
||||
except:
|
||||
self.numTourneys = 0
|
||||
print "setting numTourneys:", self.numTourneys
|
||||
print _("setting numTourneys:"), self.numTourneys
|
||||
#end def __set_num_tourneys
|
||||
|
||||
def __toggle_box(self, widget, entry): #identical with Filters
|
||||
|
|
Loading…
Reference in New Issue
Block a user