From 4696c7afaf2cec4e64a0a7442ddd9dc11f9963f9 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Sun, 15 Aug 2010 23:38:13 +0200 Subject: [PATCH] add missing gettext import --- pyfpdb/GuiAutoImport.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pyfpdb/GuiAutoImport.py b/pyfpdb/GuiAutoImport.py index 6282063f..1d4c2053 100755 --- a/pyfpdb/GuiAutoImport.py +++ b/pyfpdb/GuiAutoImport.py @@ -31,6 +31,18 @@ from optparse import OptionParser import Configuration import string +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 GuiAutoImport (threading.Thread): def __init__(self, settings, config, sql, parent): self.importtimer = 0