setup: Use xgettext --add-comments=translators

So in the code we can prefix comments with 'translators:' before
translated strings to have them show up in .pot file output

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2020-07-11 18:46:33 -04:00
parent 14f8d2ff7a
commit 35bfdc26a6
2 changed files with 4 additions and 2 deletions

View File

@ -660,6 +660,7 @@ class ExtractMessages(distutils.core.Command):
potfile = "po/virt-manager.pot"
xgettext_args = [
"xgettext",
"--add-comments=translators",
"--msgid-bugs-address=" + bug_address,
"--package-name=virt-manager",
"--output=" + potfile,

View File

@ -454,8 +454,9 @@ class XMLBuilder(object):
# know don't work
forbid = [" "]
if not val:
raise ValueError(
_("A name must be specified for the %s") % name_label)
# translators: value is a generic object type name
raise ValueError(_("A name must be specified for the %s") %
name_label)
for c in forbid:
if c not in val:
continue