aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/translated_converter.py8
1 files changed, 7 insertions, 1 deletions
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'),