Different use of args in ungettext_lazy causes error on syncing with translation infra
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Dashboard (Horizon) |
Fix Released
|
High
|
Unassigned |
Bug Description
If we look at strings for singular and plural on ungettext_lazy(),
singular string uses only "%(avail)i" arg,
and plural string uses both "%(req)i" and "%(avail)i" args.
In Zanata (translation platform), currently, po files on some languages are saved if the languages are set to just use singular form.
#: openstack_
#, python-format
msgid ""
"The requested instance cannot be launched as you only have %(avail)i of your "
"quota available. "
msgid_plural ""
"The requested %(req)i instances cannot be launched as you only have "
"%(avail)i of your quota available."
msgstr[0] ""
"The requested instance cannot be launched as you only have %(avail)i of your "
"quota available. "
This generates an error when msgfmt command is executed:
$ msgfmt --check-format -o /dev/null django.po
django.po:10766: a format specification for argument 'req' doesn't exist in 'msgstr[0]'
msgfmt: found 1 fatal error
Because of this occurrence, there have been job failures for Korean and Indonesian language
to import translated strings to Horizon git repository.
The current solution would be to add "%(req)i" argument on the singular string.
Reference
[1] http://
[2] http://
description: | updated |
tags: | added: in-stable-newton newton-backport-potential |
tags: | removed: in-stable-newton |
Changed in horizon: | |
milestone: | none → ocata-2 |
importance: | Undecided → High |
Changed in horizon: | |
assignee: | nobody → Ian Y. Choi (ianychoi) |
status: | Confirmed → In Progress |
Changed in horizon: | |
assignee: | Ian Y. Choi (ianychoi) → Rob Cresswell (robcresswell) |
Changed in horizon: | |
milestone: | next → ocata-rc1 |
Again: http:// lists.openstack .org/pipermail/ openstack- i18n/2016- October/ 002536. html
Importance would be higher.