[IMP] po file generation: write the string format after the #: comments, like launchp...
authorChristophe Simonis <christophe@tinyerp.com>
Mon, 1 Dec 2008 09:25:53 +0000 (10:25 +0100)
committerChristophe Simonis <christophe@tinyerp.com>
Mon, 1 Dec 2008 09:25:53 +0000 (10:25 +0100)
bzr revid: christophe@tinyerp.com-20081201092553-a7tfa7iydmeq4i5d

bin/tools/translate.py

index 2209aad..5163fa6 100644 (file)
@@ -178,13 +178,16 @@ class TinyPoFile(object):
         plurial = len(modules) > 1 and 's' or ''
         self.buffer.write("#. module%s: %s\n" % (plurial, ', '.join(modules)))
 
-        if "code" in map(lambda e: e[0], tnrs):
-            # only strings in python code are python formated
-            self.buffer.write("#, python-format\n")
-
 
+        code = False
         for typy, name, res_id in tnrs:
             self.buffer.write("#: %s:%s:%s\n" % (typy, name, res_id))
+            if typy == 'code':
+                code = True
+
+        if code:
+            # only strings in python code are python formated
+            self.buffer.write("#, python-format\n")
 
         if not isinstance(trad, unicode):
             trad = unicode(trad, 'utf8')