From e2374c60ce28ae1efa31399caa07e882526093f5 Mon Sep 17 00:00:00 2001 From: Worros Date: Sun, 6 Feb 2011 13:52:41 +0800 Subject: [PATCH 1/3] GuiPrefs: Fix L10n. Appears to have been missed during the transition --- pyfpdb/GuiPrefs.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/pyfpdb/GuiPrefs.py b/pyfpdb/GuiPrefs.py index 6c8c6210..166a2500 100755 --- a/pyfpdb/GuiPrefs.py +++ b/pyfpdb/GuiPrefs.py @@ -15,6 +15,9 @@ #along with this program. If not, see . #In the "official" distribution you can find the license in agpl-3.0.txt. +import L10n +_ = L10n.get_translation() + import xml.dom.minidom from xml.dom.minidom import Node @@ -23,18 +26,6 @@ pygtk.require('2.0') import gtk import gobject -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 rewrite = { 'general' : 'General', 'supported_databases' : 'Databases' From c7e289819cb236b21f3f083b564c8073fd5a54a6 Mon Sep 17 00:00:00 2001 From: Worros Date: Sun, 6 Feb 2011 14:03:11 +0800 Subject: [PATCH 2/3] GuiPositionalStats: Fix L10n. Appears to have been missed or reverted since the transition --- pyfpdb/GuiPositionalStats.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/pyfpdb/GuiPositionalStats.py b/pyfpdb/GuiPositionalStats.py index 06d28883..fc7ab83c 100644 --- a/pyfpdb/GuiPositionalStats.py +++ b/pyfpdb/GuiPositionalStats.py @@ -15,6 +15,9 @@ #along with this program. If not, see . #In the "official" distribution you can find the license in agpl-3.0.txt. +import L10n +_ = L10n.get_translation() + import threading import pygtk pygtk.require('2.0') @@ -22,18 +25,6 @@ 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 From 1f413483f4a55161240dbac4e26feccf930454c0 Mon Sep 17 00:00:00 2001 From: Worros Date: Sun, 6 Feb 2011 15:57:32 +0800 Subject: [PATCH 3/3] HUD_main: Fix L10n. Appears to have been missed or reverted since the transition --- pyfpdb/HUD_main.pyw | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/pyfpdb/HUD_main.pyw b/pyfpdb/HUD_main.pyw index 4a8cbc0d..fbbab1ee 100755 --- a/pyfpdb/HUD_main.pyw +++ b/pyfpdb/HUD_main.pyw @@ -23,6 +23,9 @@ Main for FreePokerTools HUD. """ +import L10n +_ = L10n.get_translation() + # Standard Library modules import sys import os @@ -51,21 +54,6 @@ elif sys.platform == 'darwin': else: # This is bad--figure out the values for the various windows flavors import WinTables as Tables -import locale -lang = locale.getdefaultlocale()[0][0:2] -print "lang:", lang -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 - # get config and set up logger c = Configuration.Config(file=options.config, dbname=options.dbname) log = Configuration.get_logger("logging.conf", "hud", log_dir=c.dir_log, log_file='HUD-log.txt')