From 5b042b1820287a5754d8c59f2c0325f264219367 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Tue, 17 Aug 2010 20:05:12 +0200 Subject: [PATCH] fix gettextification of Hud.py --- pyfpdb/Hud.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pyfpdb/Hud.py b/pyfpdb/Hud.py index 0c608b52..0fdf314f 100644 --- a/pyfpdb/Hud.py +++ b/pyfpdb/Hud.py @@ -42,6 +42,18 @@ if os.name == 'nt': import win32con import win32api +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 + # FreePokerTools modules import Tables # needed for testing only import Configuration @@ -180,7 +192,7 @@ class Hud: item.connect("activate", self.set_aggregation, ('P',10000)) setattr(self, 'h_aggBBmultItem10000', item) - item = gtk.MenuItem('For #Seats:')) + item = gtk.MenuItem(_('For #Seats:')) self.aggMenu.append(item) item = gtk.CheckMenuItem(_(' Any Number'))