From 2f5a7b63d33d4f25106c37eb807ec54e2c22d77b Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 16 Jan 2015 13:03:59 +0100 Subject: [PATCH] [FIX] base: keep first multiline translation in po file The first term of a po file is a comment for translator e.g.: msgid "" msgstr "" "Project-Id-Version: openobject-addons\n" ... This comment is ignored if there is no source and it is the first term of the po file. The first flage was disabled too late and if the following terms also started with an empty source (for too long terms), they were skipped as well. Disable the flag as soon as the condition is evaluated to make sure no additional terms are ignored. opw 619786 --- openerp/tools/translate.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openerp/tools/translate.py b/openerp/tools/translate.py index 0caecdf342b..4e9ffecb3aa 100644 --- a/openerp/tools/translate.py +++ b/openerp/tools/translate.py @@ -345,6 +345,7 @@ class TinyPoFile(object): source = unquote(line[6:]) line = self.lines.pop(0).strip() if not source and self.first: + self.first = False # if the source is "" and it's the first msgid, it's the special # msgstr with the informations about the traduction and the # traductor; we skip it @@ -374,8 +375,6 @@ class TinyPoFile(object): if t == trans_type == 'code': continue self.extra_lines.append((t, n, r, source, trad, comments)) - self.first = False - if name is None: if not fuzzy: self.warn('Missing "#:" formated comment at line %d for the following source:\n\t%s',