From c0eb686971bd4cd24be44cb942ee9fbf111beac0 Mon Sep 17 00:00:00 2001 From: Worros Date: Sat, 4 Sep 2010 13:08:36 +0800 Subject: [PATCH] StarsSummary: Fix gettextify problem --- pyfpdb/PokerStarsSummary.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pyfpdb/PokerStarsSummary.py b/pyfpdb/PokerStarsSummary.py index 30421ea2..14b9cadc 100644 --- a/pyfpdb/PokerStarsSummary.py +++ b/pyfpdb/PokerStarsSummary.py @@ -25,6 +25,20 @@ from HandHistoryConverter import * import PokerStarsToFpdb from TourneySummary import * +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 PokerStarsSummary(TourneySummary): limits = { 'No Limit':'nl', 'Pot Limit':'pl', 'Limit':'fl', 'LIMIT':'fl' } games = { # base, category