From 2ae2d0d277abbeaab06f8a058b63ea16d5e4136c Mon Sep 17 00:00:00 2001 From: sqlcoder Date: Sat, 21 Aug 2010 23:24:25 +0100 Subject: [PATCH] define _ func --- pyfpdb/WinTables.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pyfpdb/WinTables.py b/pyfpdb/WinTables.py index 6c68cd98..adaa82be 100644 --- a/pyfpdb/WinTables.py +++ b/pyfpdb/WinTables.py @@ -40,6 +40,18 @@ import win32api import win32con import win32security +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 from TableWindow import Table_Window