accerciser r685 - in trunk: . po src/lib/accerciser src/lib/accerciser/plugin



Author: eitani
Date: Wed Jan 28 12:31:11 2009
New Revision: 685
URL: http://svn.gnome.org/viewvc/accerciser?rev=685&view=rev

Log:
    	* po/ca.po:
    	* po/el.po:
    	* po/es.po:
    	* po/hu.po:
    	* po/nb.po:
    	* po/sl.po:
    	* po/sv.po:
    	* po/zh_CN.po: Updated PO files for msgctx.

    * src/lib/accerciser/i18n.py.in:
    * src/lib/accerciser/plugin/plugin_manager.py:
    * src/lib/accerciser/ui_manager.py: Use C_() instead of Q_() with
    context (bug #569341).

Modified:
   trunk/ChangeLog
   trunk/po/ca.po
   trunk/po/el.po
   trunk/po/es.po
   trunk/po/hu.po
   trunk/po/nb.po
   trunk/po/sl.po
   trunk/po/sv.po
   trunk/po/zh_CN.po
   trunk/src/lib/accerciser/i18n.py.in
   trunk/src/lib/accerciser/plugin/plugin_manager.py
   trunk/src/lib/accerciser/ui_manager.py

Modified: trunk/src/lib/accerciser/i18n.py.in
==============================================================================
--- trunk/src/lib/accerciser/i18n.py.in	(original)
+++ trunk/src/lib/accerciser/i18n.py.in	Wed Jan 28 12:31:11 2009
@@ -61,21 +61,16 @@
 # build a default instance to the LSR domain and locale directory
 _ = bind(DOMAIN, LOCALE_DIR)
 
-def Q_(s):
+def C_(ctx, s):
   '''Provide qualified translatable strings.  Some strings translate to
   more than one string in another locale.  We provide a convention to
   provide contextual information for the string so that translators can
-  do the right thing: we embed a '|' character in the string to be
-  translated.  The string before the '|' provides the context, and the
-  string after the '|' provides the string to translate.  For example:
-  'radiobutton|selected' and 'text|selected' are used to provide context
-  for the word 'selected'.
-  
-  We need to handle the case where the string has not been translated,
-  however, and we do so by stripping off the contextual information.
-
-  Plagiarized from Orca'''
-  return _(s).split('|', 1)[-1]
+  do the right thing.'''
+  translated = _('%s\x04%s' % (ctx, s))
+  if '\x04' in translated:
+    # no translation found, return input string
+    return s
+  return translated
 
 # allow gettext to extract the string, but it should not be translated inline.
 N_ = lambda string: string

Modified: trunk/src/lib/accerciser/plugin/plugin_manager.py
==============================================================================
--- trunk/src/lib/accerciser/plugin/plugin_manager.py	(original)
+++ trunk/src/lib/accerciser/plugin/plugin_manager.py	Wed Jan 28 12:31:11 2009
@@ -22,7 +22,7 @@
 import imp
 import traceback
 import gconf
-from accerciser.i18n import _, N_, Q_
+from accerciser.i18n import _, N_, C_
 
 GCONF_PLUGIN_DISABLED = '/apps/accerciser/disabled_plugins'      
 
@@ -375,7 +375,7 @@
       # Translators: This is the viewport in which the plugin appears,
       # it is a noun.
       # 
-      tvc = gtk.TreeViewColumn(Q_('viewport|View'))
+      tvc = gtk.TreeViewColumn(C_('viewport', 'View'))
       tvc.pack_start(crc, False)
       tvc.set_cell_data_func(crc, self._viewNameDataFunc)
       crc.set_property('editable', True)

Modified: trunk/src/lib/accerciser/ui_manager.py
==============================================================================
--- trunk/src/lib/accerciser/ui_manager.py	(original)
+++ trunk/src/lib/accerciser/ui_manager.py	Wed Jan 28 12:31:11 2009
@@ -12,15 +12,15 @@
 '''
 
 import gtk
-from i18n import _, N_, Q_
+from i18n import _, N_, C_
 
 menu_actions = gtk.ActionGroup('MenuActions')
 
 menu_actions.add_actions([
     ('File', None, _('_File')),
     ('Edit', None, _('_Edit')),
-    ('Bookmarks', None, Q_('menu|_Bookmarks')),
-    ('View', None, Q_('menu|_View')),
+    ('Bookmarks', None, C_('menu', '_Bookmarks')),
+    ('View', None, C_('menu', '_View')),
     ('Help', None, _('_Help'))])
 
 ui_xml = '''



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]