From 4a3dbc5fb150184d4bbc89ca6620b76de8725d6b Mon Sep 17 00:00:00 2001 From: Filip Komar Date: Fri, 14 Mar 2014 21:01:09 +0000 Subject: increase default wrap limit and exclusion of untranslated entry --- tools/translated_converter.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/translated_converter.py b/tools/translated_converter.py index 6418ababd..80adf14bc 100644 --- a/tools/translated_converter.py +++ b/tools/translated_converter.py @@ -48,7 +48,7 @@ for langfile in glob.glob(file_mask): text = text.replace('\n\n','\n\n\n\n')+'\n' # Write PO file - po = polib.POFile() + po = polib.POFile(wrapwidth=999) # increase default wrap limit pocreationtime = strftime('%Y-%m-%d %H:%M%z') po.metadata = { 'Project-Id-Version': langfile, @@ -73,6 +73,8 @@ for langfile in glob.glob(file_mask): message_id, message_str = message_text.split('\n',1) # Strip ';' from msgid message_id = message_id.lstrip(';') + if message_str == message_id: + message_str='' potentry = polib.POEntry( # msgctxt = message_comment, msgid = message_id.decode('utf-8'), @@ -86,6 +88,8 @@ for langfile in glob.glob(file_mask): message_id, message_str = mblock.strip('\n').split('\n',1) # Strip ';' from msgid message_id = message_id.lstrip(';') + if message_str == message_id: + message_str='' potentry = polib.POEntry( msgid = message_id.decode('utf-8'), msgstr = message_str.decode('utf-8'), @@ -96,6 +100,8 @@ for langfile in glob.glob(file_mask): message_id, message_str = text.partition('\n\n')[0].strip('\n').split('\n',1) # Strip ';' from msgid message_id = message_id.lstrip(';') + if message_str == message_id: + message_str='' potentry = polib.POEntry( msgid = message_id.decode('utf-8'), msgstr = message_str.decode('utf-8'), -- cgit v1.2.1