Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2012-05-29 18:31:13 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-05-29 18:31:13 (GMT)
commit4686331858ba903c7e8a73905313d8614cd7cb0f (patch)
tree6bb153b8a420b07d799a6fabe907bcc7cfac2601
parent88f0496e1800c63932182586361f8b338f620498 (diff)
Use gettext to translate the "Next" button
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
-rw-r--r--activity.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/activity.py b/activity.py
index 44ea803..046b05a 100644
--- a/activity.py
+++ b/activity.py
@@ -16,7 +16,8 @@
import os
import logging
-from gettext import gettext as _
+#from gettext import gettext as _
+import gettext
import gtk
import gobject
@@ -128,9 +129,17 @@ class ImageCollectionViewer(gtk.VBox):
right_box = gtk.HBox()
bottom_toolbar.pack_start(right_box, False, padding=0)
+ # init gettext
+ locale_path = \
+ os.path.expanduser('~/Activities/Welcome.activity/locale/')
+ gettext.bindtextdomain('org.laptop.WelcomeActivity', locale_path)
+ gettext.textdomain('org.laptop.WelcomeActivity')
+ _ = gettext.gettext
+
_next_button = gtk.Button()
- _next_button.set_label(gtk.STOCK_GO_FORWARD)
- _next_button.set_use_stock(True)
+ _next_button.set_label(_('Next'))
+ next_image = Icon(icon_name='go-right')
+ _next_button.set_image(next_image)
_next_button.connect('clicked', self.__next_clicked_cb)
right_box.pack_end(_next_button, False, False,
padding=style.zoom(30))