From c9e032795b12fcc779bdde570f3ed092cbfbfccd Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Tue, 1 Jun 2021 10:38:43 +0100 Subject: [PATCH] Only extract comments with the "Translator" tag Previously all comments before a translated string were extracted. This change prevents translators from seeing unnecessary or misleading comments. --- po/update_po.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/po/update_po.py b/po/update_po.py index 509ff74b1..22e5a91be 100644 --- a/po/update_po.py +++ b/po/update_po.py @@ -423,8 +423,9 @@ def retrieve(): listing('python.txt', ['.py', '.py.in']) # additional keywords must always be kept in sync with those in genpot.sh - os.system('''%(xgettext)s -F -c -j --directory=./ -d gramps ''' - '''-L Python -o gramps.pot --files-from=python.txt ''' + os.system('''%(xgettext)s -F --add-comments=Translators -j ''' + '''--directory=./ -d gramps -L Python ''' + '''-o gramps.pot --files-from=python.txt ''' '''--debug --keyword=_ --keyword=ngettext ''' '''--keyword=_T_ --keyword=trans_text:1,2c ''' '''--keyword=_:1,2c --keyword=_T_:1,2c ''' @@ -437,8 +438,8 @@ def retrieve(): # C format header (.h extension) for h in headers(): print ('xgettext for %s' % h) - os.system('''%(xgettext)s -F --add-comments -j -o gramps.pot ''' - '''--keyword=N_ --from-code=UTF-8 %(head)s''' + os.system('''%(xgettext)s -F --add-comments=Translators -j ''' + '''-o gramps.pot --keyword=N_ --from-code=UTF-8 %(head)s''' % {'xgettext': xgettextCmd, 'head': h} ) clean()