From e8d0c425667bb3f21559eb895f0ddf7556413376 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Mon, 16 Aug 2010 23:49:50 +0200 Subject: [PATCH] gettext import for guiprefs --- pyfpdb/GuiPrefs.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pyfpdb/GuiPrefs.py b/pyfpdb/GuiPrefs.py index 6d908ec6..6c8c6210 100755 --- a/pyfpdb/GuiPrefs.py +++ b/pyfpdb/GuiPrefs.py @@ -23,8 +23,19 @@ pygtk.require('2.0') import gtk import gobject -import Configuration +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' , 'import' : 'Import', 'hud_ui' : 'HUD'