diff options
author | 2008-05-26 01:55:03 +0000 | |
---|---|---|
committer | 2008-05-26 01:55:03 +0000 | |
commit | 7a53125e75cc7b034f3a00be820006bb0a782855 (patch) | |
tree | 4a167c314a744a096bee8a0ad3fabb2793d58040 | |
parent | adding languages po and spanish translation, (diff) | |
download | gli-7a53125e75cc7b034f3a00be820006bb0a782855.tar.gz gli-7a53125e75cc7b034f3a00be820006bb0a782855.tar.bz2 gli-7a53125e75cc7b034f3a00be820006bb0a782855.zip |
adding gettext support written by Jesus Rivero (Neurogeek)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/gli/trunk@1903 f8877401-5920-0410-a79b-8e2d7e04ca0d
-rwxr-xr-x | src/fe/gtk/gtkfe.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/fe/gtk/gtkfe.py b/src/fe/gtk/gtkfe.py index 9618ed3..d8b0a20 100755 --- a/src/fe/gtk/gtkfe.py +++ b/src/fe/gtk/gtkfe.py @@ -14,10 +14,18 @@ import GLIClientController import GLIUtility from SplashScreen import SplashScreen import gtk -from gettext import gettext as _ +import gettext import TextBufferMarkup from ProgressDialog import * + +try: + gettext.install('gli-gtk', './languages') + translator = gettext.translation('gli-gtk', './languages') + _ = translator.gettext +except: + _ = gettext.gettext + class Installer: SHOW_BUTTON_FORWARD = 1 @@ -218,11 +226,11 @@ class Installer: def exit_button(self, widget, data=None): if not self.install_done: - msgdlg = gtk.MessageDialog(parent=self.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format="Are you sure you want to exit?") + msgdlg = gtk.MessageDialog(parent=self.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format=_("Are you sure you want to exit?")) resp = msgdlg.run() msgdlg.destroy() if resp == gtk.RESPONSE_YES: - msgdlg = gtk.MessageDialog(parent=self.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format="Do you want the installer to clean up after itself before exiting?") + msgdlg = gtk.MessageDialog(parent=self.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format=_("Do you want the installer to clean up after itself before exiting?")) resp = msgdlg.run() msgdlg.destroy() if resp == gtk.RESPONSE_YES: |