diff options
author | Sebastian Droege <slomo@ubuntu.com> | 2005-10-06 14:41:58 +0000 |
---|---|---|
committer | Sebastian Droege <slomo@ubuntu.com> | 2005-10-06 14:41:58 +0000 |
commit | 37199f0fd28d5f036d99d4755544ffa90436b600 (patch) | |
tree | e9ec1a068ad654801cba3b16172c243053222c74 /actions | |
parent | aeb1d09124bd57ecf78e138c4466d682827eb354 (diff) |
* added localization to sda
git-svn-id: file:///home/lennart/svn/public/service-discovery-applet/trunk@45 3be567f1-68ff-0310-b24a-ad7cc433fd2f
Diffstat (limited to 'actions')
-rw-r--r-- | actions/services/Makefile.am | 2 | ||||
-rwxr-xr-x | actions/services/__init__.py.in | 26 |
2 files changed, 19 insertions, 9 deletions
diff --git a/actions/services/Makefile.am b/actions/services/Makefile.am index d90fa28..651a31e 100644 --- a/actions/services/Makefile.am +++ b/actions/services/Makefile.am @@ -5,6 +5,8 @@ services_SCRIPTS = \ __init__.py: __init__.py.in sed \ -e 's,@PYTHON\@,$(PYTHON),g' \ + -e 's,@GETTEXT_PACKAGE\@,$(GETTEXT_PACKAGE),g' \ + -e 's,@LOCALEDIR\@,$(LOCALEDIR),g' \ $< > $@ chmod +x $@ diff --git a/actions/services/__init__.py.in b/actions/services/__init__.py.in index 0fc81bd..df6a8b4 100755 --- a/actions/services/__init__.py.in +++ b/actions/services/__init__.py.in @@ -18,13 +18,21 @@ # it will hopefully appear in 0.3 # this file is just an interim solution to give the same functionnaly as 0.1 -import pygtk -pygtk.require('2.0') -import gtk -import os -import pwd -import subprocess -import gnome +try: + import gettext + gettext.bindtextdomain("@GETTEXT_PACKAGE@", "@LOCALEDIR@") + gettext.textdomain("@GETTEXT_PACKAGE@") + gettext.install("@GETTEXT_PACKAGE@", unicode=1) + import pygtk + pygtk.require('2.0') + import gtk + import os + import pwd + import subprocess + import gnome +except ImportError, e: + error_msg(_("A python module is missing.\n%s") % (e)) + sys.exit() def pair_to_dict(l): res = dict() @@ -96,7 +104,7 @@ def enter_callback(widget, win): def SshLogin(hostname, username = None): global win - win = gtk.Dialog("Ssh Connection", None, + win = gtk.Dialog(_("SSH Connection"), None, gtk.DIALOG_MODAL, (gtk.STOCK_OK, gtk.RESPONSE_OK)) @@ -105,7 +113,7 @@ def SshLogin(hostname, username = None): vbox.set_border_width(5) label = gtk.Label() - label.set_markup("Connecting to <b>%s</b>.\nPlease enter your <b>login</b>:" % (hostname)) + label.set_markup(_("Connecting to <b>%s</b>.\nPlease enter your <b>login</b>:") % (hostname)) vbox.pack_start(label, False, False, 0) |