set project name and character set in generated messages.pot
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Thu, 22 Jun 2017 16:06:34 +0300
changeset 1703 ba0dde7f047a
parent 1702 bbb2c38969ca
child 1704 794a47ef5323
set project name and character set in generated messages.pot
i18n/mki18n.py
--- a/i18n/mki18n.py	Thu Jun 22 15:55:26 2017 +0300
+++ b/i18n/mki18n.py	Thu Jun 22 16:06:34 2017 +0300
@@ -182,9 +182,13 @@
     #   -s                          : sort output by string content (easier to use when we need to merge several .po files)
     #   --files-from=app.fil        : The list of files is taken from the file: app.fil
     #   --output=                   : specifies the name of the output file (using a .pot extension)
-    cmd = 'xgettext -s --no-wrap --language=Python --files-from=' + filelist + ' --output=' + fileout
+    cmd = 'xgettext -s --no-wrap --language=Python --files-from=' + filelist + ' --output=' + fileout + ' --package-name ' + applicationName
     if verbose: print cmd
-    os.system(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')