aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilip Komar <filip@mageia.org>2014-03-14 21:01:09 +0000
committerFilip Komar <filip@mageia.org>2014-03-14 21:01:09 +0000
commit4a3dbc5fb150184d4bbc89ca6620b76de8725d6b (patch)
treea17702cb14938c59a364d46d7c8126a87d36ed84
parent3bd43c88fcb53f8a068c11e89ad1fece00b0b73b (diff)
downloadwww-4a3dbc5fb150184d4bbc89ca6620b76de8725d6b.tar
www-4a3dbc5fb150184d4bbc89ca6620b76de8725d6b.tar.gz
www-4a3dbc5fb150184d4bbc89ca6620b76de8725d6b.tar.bz2
www-4a3dbc5fb150184d4bbc89ca6620b76de8725d6b.tar.xz
www-4a3dbc5fb150184d4bbc89ca6620b76de8725d6b.zip
increase default wrap limit and exclusion of untranslated entry
-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'),