mki18n.py: generate messages.po (contains English strings in msgstr)
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Wed, 05 Jul 2017 13:02:30 +0300
changeset 1715 f50486ecdc21
parent 1714 64ea7c86a74c
child 1716 ccb2ed164418
mki18n.py: generate messages.po (contains English strings in msgstr)

This po file is necessary because Transifex translation platform
automatically can only import PO files. Usually messages.pot is
enough.
i18n/mki18n.py
--- a/i18n/mki18n.py	Wed Jul 05 12:59:43 2017 +0300
+++ b/i18n/mki18n.py	Wed Jul 05 13:02:30 2017 +0300
@@ -186,16 +186,17 @@
     if verbose: print cmd
     os.system(cmd)
 
-    cmd = 'sed --in-place ' + fileout + ' --expression=s/CHARSET/UTF-8/'
-    if verbose: print cmd
-    os.system(cmd)
-
     XSD_STRING_MODEL = re.compile("<xsd\:(?:element|attribute) name=\"([^\"]*)\"[^\>]*\>")
     processCustomFiles(filelist, fileout, XSD_STRING_MODEL, 'Extra XSD strings')
 
     XML_TC6_STRING_MODEL = re.compile("<documentation>\s*<xhtml\:p><!\[CDATA\[([^\]]*)\]\]></xhtml\:p>\s*</documentation>", re.MULTILINE | re.DOTALL)
     processCustomFiles(filelist, fileout, XML_TC6_STRING_MODEL, 'Extra TC6 documentation strings')    
 
+    # generate messages.po
+    cmd = 'msginit --no-wrap --no-translator -i %s -l en_US.UTF-8 -o messages.po' % (fileout)
+    if verbose: print cmd
+    os.system(cmd)    
+
     languageDict = getlanguageDict()
 
     for langCode in languageDict.keys():