[Sugar-devel] [PATCH sugar v2 2/2] Allow "Remove" in Clipboard resp. Volumes palette to be translated differently

Sascha Silbe silbe at activitycentral.com
Sat Feb 12 07:27:41 EST 2011


Some languages (e.g. Spanish) benefit from having the translation for the
"Remove" item in the Volumes palette different from the translation for the
"Remove" item in the Clipboard palette.

This builds on the pgettext() support in sugar-toolkit.

Signed-off-by: Sascha Silbe <silbe at activitycentral.com>
---
 src/jarabe/frame/clipboardmenu.py |    4 +++-
 src/jarabe/view/palettes.py       |    3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/jarabe/frame/clipboardmenu.py b/src/jarabe/frame/clipboardmenu.py
index d11538d..1d22d8e 100644
--- a/src/jarabe/frame/clipboardmenu.py
+++ b/src/jarabe/frame/clipboardmenu.py
@@ -30,6 +30,7 @@ from sugar.graphics.xocolor import XoColor
 from sugar.datastore import datastore
 from sugar import mime
 from sugar import env
+from sugar.activity.i18n import pgettext
 
 from jarabe.frame import clipboard
 from jarabe.journal import misc
@@ -51,7 +52,8 @@ class ClipboardMenu(Palette):
 
         self._progress_bar = None
 
-        self._remove_item = MenuItem(_('Remove'), 'list-remove')
+        self._remove_item = MenuItem(pgettext('Clipboard', 'Remove'),
+                                     'list-remove')
         self._remove_item.connect('activate', self._remove_item_activate_cb)
         self.menu.append(self._remove_item)
         self._remove_item.show()
diff --git a/src/jarabe/view/palettes.py b/src/jarabe/view/palettes.py
index d9c1f6b..a13be46 100644
--- a/src/jarabe/view/palettes.py
+++ b/src/jarabe/view/palettes.py
@@ -28,6 +28,7 @@ from sugar.graphics.menuitem import MenuItem
 from sugar.graphics.icon import Icon
 from sugar.graphics import style
 from sugar.graphics.xocolor import XoColor
+from sugar.activity.i18n import pgettext
 
 from jarabe.model import shell
 from jarabe.view.viewsource import setup_view_source
@@ -217,7 +218,7 @@ class VolumePalette(Palette):
 
         self.connect('popup', self.__popup_cb)
 
-        menu_item = MenuItem(_('Remove'))
+        menu_item = MenuItem(pgettext('Volume', 'Remove'))
 
         icon = Icon(icon_name='media-eject', icon_size=gtk.ICON_SIZE_MENU)
         menu_item.set_image(icon)
-- 
1.7.2.3



More information about the Sugar-devel mailing list