commit-gnue
[Top][All Lists]
Advanced

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

r5374 - in trunk/gnue-common/src: apps schema/scripter/processors


From: reinhard
Subject: r5374 - in trunk/gnue-common/src: apps schema/scripter/processors
Date: Fri, 19 Mar 2004 04:44:37 -0600 (CST)

Author: reinhard
Date: 2004-03-19 04:44:35 -0600 (Fri, 19 Mar 2004)
New Revision: 5374

Modified:
   trunk/gnue-common/src/apps/i18n.py
   trunk/gnue-common/src/schema/scripter/processors/Base.py
Log:
Fixed translation for file output.


Modified: trunk/gnue-common/src/apps/i18n.py
===================================================================
--- trunk/gnue-common/src/apps/i18n.py  2004-03-19 08:08:39 UTC (rev 5373)
+++ trunk/gnue-common/src/apps/i18n.py  2004-03-19 10:44:35 UTC (rev 5374)
@@ -63,7 +63,7 @@
 # Translate a message. This is the actual implementation of _()
 # -----------------------------------------------------------------------------
 
-def translate (msg):
+def translate (msg, unicode = False):
 
   # find out the filename of the calling function
   caller_file = (sys._getframe (1)).f_code.co_filename
@@ -99,7 +99,10 @@
   # catalog.gettext (msg) returns a string in the po-file's encoding. We want
   # the user's encoding, so we have to convert.
   # FIXME: Actually, this function should return unicode values.
-  return (catalog.ugettext (msg)).encode (encoding, enc_policy)
+  if unicode:
+    return catalog.ugettext (msg)
+  else:
+    return (catalog.ugettext (msg)).encode (encoding, enc_policy)
 
 # -----------------------------------------------------------------------------
 # Convert Unicode to String, let everything else untouched. This is o().

Modified: trunk/gnue-common/src/schema/scripter/processors/Base.py
===================================================================
--- trunk/gnue-common/src/schema/scripter/processors/Base.py    2004-03-19 
08:08:39 UTC (rev 5373)
+++ trunk/gnue-common/src/schema/scripter/processors/Base.py    2004-03-19 
10:44:35 UTC (rev 5374)
@@ -368,8 +368,8 @@
     if encoding is not None:
       self.encoding = encoding
 
-    self._writeText (self.comment (_("Client encoding set to '%s'" % \
-                                     self.encoding)))
+    self._writeText (self.comment (_("Client encoding set to '%s'", True) % \
+                                     self.encoding))
 
   
   # ---------------------------------------------------------------------------
@@ -426,12 +426,12 @@
     'per-generation' actions, e.g. set encoding 
     """
     today = "%s UTC" % now ()
-    text = _("This file was generated by gnue-schema\nfrom %s on %s.") % \
+    text = _("This file was generated by gnue-schema\nfrom %s on %s.", True) % 
\
             (self.source, today)
 
     self._writeText (u"\n")
     self._writeText (self.comment (text.splitlines () + \
-                     ["", _("Do NOT edit manually!")]))
+                     ["", _("Do NOT edit manually!", True)]))
     self._writeText (u"\n")
 
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]