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.
This commit is contained in:
Nick Hall 2021-06-01 10:38:43 +01:00
parent d54762d534
commit c9e032795b

View File

@ -423,8 +423,9 @@ def retrieve():
listing('python.txt', ['.py', '.py.in']) listing('python.txt', ['.py', '.py.in'])
# additional keywords must always be kept in sync with those in genpot.sh # additional keywords must always be kept in sync with those in genpot.sh
os.system('''%(xgettext)s -F -c -j --directory=./ -d gramps ''' os.system('''%(xgettext)s -F --add-comments=Translators -j '''
'''-L Python -o gramps.pot --files-from=python.txt ''' '''--directory=./ -d gramps -L Python '''
'''-o gramps.pot --files-from=python.txt '''
'''--debug --keyword=_ --keyword=ngettext ''' '''--debug --keyword=_ --keyword=ngettext '''
'''--keyword=_T_ --keyword=trans_text:1,2c ''' '''--keyword=_T_ --keyword=trans_text:1,2c '''
'''--keyword=_:1,2c --keyword=_T_:1,2c ''' '''--keyword=_:1,2c --keyword=_T_:1,2c '''
@ -437,8 +438,8 @@ def retrieve():
# C format header (.h extension) # C format header (.h extension)
for h in headers(): for h in headers():
print ('xgettext for %s' % h) print ('xgettext for %s' % h)
os.system('''%(xgettext)s -F --add-comments -j -o gramps.pot ''' os.system('''%(xgettext)s -F --add-comments=Translators -j '''
'''--keyword=N_ --from-code=UTF-8 %(head)s''' '''-o gramps.pot --keyword=N_ --from-code=UTF-8 %(head)s'''
% {'xgettext': xgettextCmd, 'head': h} % {'xgettext': xgettextCmd, 'head': h}
) )
clean() clean()