[Sugar-devel] [PATCH] sl#3149: Localization fixes.

Ajay Garg ajay at activitycentral.com
Mon Jan 23 08:48:16 EST 2012


---

Removed unncessary "gettext" notations; plus added "TRANS" labels for not
translating format-specifier tokens.

Thanks Chris Leonard.

 extensions/cpsection/aboutcomputer/model.py |    2 +-
 src/jarabe/desktop/favoritesview.py         |    2 +-
 src/jarabe/frame/activitiestray.py          |    7 +++++--
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/extensions/cpsection/aboutcomputer/model.py b/extensions/cpsection/aboutcomputer/model.py
index 431c9c0..86d2e3f 100644
--- a/extensions/cpsection/aboutcomputer/model.py
+++ b/extensions/cpsection/aboutcomputer/model.py
@@ -180,7 +180,7 @@ def get_wireless_firmware():
     if len(firmware_info) == 1:
         return firmware_info.values()[0]
 
-    return ', '.join([_('%(interface)s: %(version)s') %
+    return ', '.join(['%(interface)s: %(version)s' %
                       {'interface': interface, 'version': version}
                       for interface, version in firmware_info.items()])
 
diff --git a/src/jarabe/desktop/favoritesview.py b/src/jarabe/desktop/favoritesview.py
index 132d14f..5c76cdc 100644
--- a/src/jarabe/desktop/favoritesview.py
+++ b/src/jarabe/desktop/favoritesview.py
@@ -336,7 +336,7 @@ class FavoritesView(hippo.Canvas):
             schoolserver.register_laptop()
         except RegisterError, e:
             alert.props.title = _('Registration Failed')
-            alert.props.msg = _('%s') % e
+            alert.props.msg = '%s' % e
         else:
             alert.props.title = _('Registration Successful')
             alert.props.msg = _('You are now registered ' \
diff --git a/src/jarabe/frame/activitiestray.py b/src/jarabe/frame/activitiestray.py
index 941b174..2b8b7c6 100644
--- a/src/jarabe/frame/activitiestray.py
+++ b/src/jarabe/frame/activitiestray.py
@@ -541,6 +541,7 @@ class BaseTransferPalette(Palette):
         transferred = self._format_size(
                 self.file_transfer.props.transferred_bytes)
         total = self._format_size(self.file_transfer.file_size)
+        # TRANS: do not translate the two "%s".
         self.progress_label.props.label = _('%s of %s') % (transferred, total)
 
 
@@ -555,6 +556,7 @@ class IncomingTransferPalette(BaseTransferPalette):
         self.file_transfer.connect('notify::state', self.__notify_state_cb)
 
         nick = str(self.file_transfer.buddy.props.nick)
+        # TRANS: do not translate the token "%s".
         label = glib.markup_escape_text(_('Transfer from %s') % (nick,))
         self.props.secondary_text = label
 
@@ -589,7 +591,7 @@ class IncomingTransferPalette(BaseTransferPalette):
             type_description = mime.get_mime_description(mime_type)
 
             size = self._format_size(self.file_transfer.file_size)
-            label = gtk.Label(_('%s (%s)') % (size, type_description))
+            label = gtk.Label('%s (%s)' % (size, type_description))
             vbox.add(label)
             label.show()
 
@@ -688,6 +690,7 @@ class OutgoingTransferPalette(BaseTransferPalette):
         self.file_transfer.connect('notify::state', self.__notify_state_cb)
 
         nick = str(file_transfer.buddy.props.nick)
+        # TRANS: do not translate "%s".
         label = glib.markup_escape_text(_('Transfer to %s') % (nick,))
         self.props.secondary_text = label
 
@@ -719,7 +722,7 @@ class OutgoingTransferPalette(BaseTransferPalette):
             type_description = mime.get_mime_description(mime_type)
 
             size = self._format_size(self.file_transfer.file_size)
-            label = gtk.Label(_('%s (%s)') % (size, type_description))
+            label = gtk.Label('%s (%s)' % (size, type_description))
             vbox.add(label)
             label.show()
 
-- 
1.7.4.4



More information about the Sugar-devel mailing list