[FIX] Translation: Error parsing .po files when application puts comments in a single...
authormra (Open ERP) <mra@tinyerp.com>
Thu, 3 Dec 2009 12:09:14 +0000 (17:39 +0530)
committermra (Open ERP) <mra@tinyerp.com>
Thu, 3 Dec 2009 12:09:14 +0000 (17:39 +0530)
lp bug: https://launchpad.net/bugs/491365 fixed

bzr revid: mra@tinyerp.com-20091203120914-cx2kv7gk7zg65248

bin/tools/translate.py

index ca833df..e41a5d9 100644 (file)
@@ -188,7 +188,12 @@ class TinyPoFile(object):
                     raise StopIteration()
                 line = self.lines.pop(0).strip()
                 if line.startswith('#:'): 
-                    tmp_tnrs.append( line[2:].strip().split(':') )
+                    for item in line[2:].strip().split(' '):
+                        value = item.split(':')
+                        if len(value) == 3:
+                            if value[2].endswith(','):
+                                value[2] = value[2][:-1]
+                            tmp_tnrs.append( value )
                 if line.startswith('#'):
                     line = None