From ecf335c19cb80471dcda8d2481382bf5d34c6a5f Mon Sep 17 00:00:00 2001 From: Ibiam Chihurumnaya Date: Fri, 21 Feb 2020 17:23:19 +0100 Subject: [PATCH] Add --from-code parameter to xgettext for a python3 activity Signed-off-by: Ibiam Chihurumnaya --- src/sugar3/activity/bundlebuilder.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sugar3/activity/bundlebuilder.py b/src/sugar3/activity/bundlebuilder.py index 2c4a875d..9fd38390 100644 --- a/src/sugar3/activity/bundlebuilder.py +++ b/src/sugar3/activity/bundlebuilder.py @@ -26,6 +26,7 @@ is setup by creating a `setup.py` file in the project with the following:: bundlebuilder.start() ''' +import six import argparse import operator import os @@ -563,7 +564,10 @@ def cmd_genpot(config, options): f.close() 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 retcode = subprocess.call(args)