Thank you, Akihiro-san.

I agree that it is better to use same variables as much as possible.

Akihiro Motoki wrote on 9/19/2016 7:21 AM:
Hi Ian,

gettext itself allows this pattern [1] but django compilemessage
expects variables with same names are used in all plural forms (See
Note in [2]).
IMHO it is better to use same variables in all plural forms in code as
possible as we can.
As translator, I try to use the second pattern (i.e., plural form) as
source string as a plural form contains sufficient and full pattern in
most cases.
Yep it would be a Fuzzy form for translation in Zanata, but that's okay for me. I have fixed in Korean,
and checked that there is no error for 'msgfmt --check-format ' command.

With many thanks,

What I am not sure is this happens only for languages with nplural==1
(like Korean, Japanese and so on).



2016-09-16 18:57 GMT+09:00 Ian Y. Choi <>:

Recently, thanks to the help from Andreas, I am investigating on a broken
for the translation import of Horizon project [1].
The actual error message is
: openstack_dashboard/locale/ko_KR/LC_MESSAGES/django.po:8273: a format
specification for argument 'req' doesn't exist in 'msgstr[0]'

And then I have found that this error was from a string in horizon -
openstack_dashboard [2]

             error_message = ungettext_lazy(
                 'The requested instance cannot be launched as you only '
                 'have %(avail)i of your quota available. ',
                 'The requested %(req)i instances cannot be launched as you '
                 'only have %(avail)i of your quota available.',
             params = {'req': count,
                       'avail': available_count}

In i18n translation infrastructure, only one of two (for singular and
plural) strings should be
selected, translated, saved, and finally imported back to Horizon project as
However, the first string only used "%(avail)i" string variable,
and the second string used both "%(req)i" and "%(avail)i" string variables.

Since one Korean translator selected the first string, there will be no
"%(req)i" in Korean po file, which generates such an error.
So my suggestion is to use the same string variables for both two strings
when we use ungettext_lazy function.

Is it a bug from Horizon? Would it be other issues when we change like
: from 'The requested instance cannot be launched as you only ' to 'The
requested %(req)i instance cannot be launched as you only '?


With many thanks,


OpenStack-I18n mailing list

OpenStack Development Mailing List (not for usage questions)

Reply via email to