From 39f00225b96499fbc765f9eaa353a93ebe8912e2 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Tue, 25 Aug 2009 16:49:33 +0200 Subject: GUI: added first part of support for gettext --- src/Gui/CCMainWindow.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/Gui/CCMainWindow.py b/src/Gui/CCMainWindow.py index e96db2b..d36eb73 100644 --- a/src/Gui/CCMainWindow.py +++ b/src/Gui/CCMainWindow.py @@ -21,6 +21,21 @@ try: except Exception, ex: rpm = None + +PROGNAME = "abrt" +import locale +try: + locale.setlocale (locale.LC_ALL, "") +except locale.Error, e: + import os + os.environ['LC_ALL'] = 'C' + locale.setlocale (locale.LC_ALL, "") +import gettext +gettext.bind_textdomain_codeset(PROGNAME,locale.nl_langinfo(locale.CODESET)) +gettext.bindtextdomain(PROGNAME, '/usr/share/locale') +gettext.textdomain(PROGNAME) +_ = lambda x: gettext.lgettext(x) + #installExceptionHandler("abrt-gui", "0.0.7") class MainWindow(): -- cgit