Add --from-code parameter to xgettext for a python3 activity

Signed-off-by: Ibiam Chihurumnaya <ibiamchihurumnaya@gmail.com>
This commit is contained in:
Ibiam Chihurumnaya 2020-02-21 17:23:19 +01:00 committed by James Cameron
parent 6fc675e848
commit ecf335c19c

View File

@ -26,6 +26,7 @@ is setup by creating a `setup.py` file in the project with the following::
bundlebuilder.start() bundlebuilder.start()
''' '''
import six
import argparse import argparse
import operator import operator
import os import os
@ -563,7 +564,10 @@ def cmd_genpot(config, options):
f.close() f.close()
args = ['xgettext', '--join-existing', '--language=Python', args = ['xgettext', '--join-existing', '--language=Python',
'--keyword=_', '--add-comments=TRANS:', '--output=%s' % pot_file] '--keyword=_', '--add-comments=TRANS:',
'--output=%s' % pot_file]
if six.PY3:
args.insert(5, '--from-code=UTF-8')
args += python_files args += python_files
retcode = subprocess.call(args) retcode = subprocess.call(args)