[horizon] Question on a singular/plural string use in openstack_dashboard
Hello, Recently, thanks to the help from Andreas, I am investigating on a broken job 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.', count) 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 [1]. 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 '? [1] http://logs.openstack.org/periodic/horizon-propose-translation-update/c038aa... [2] http://git.openstack.org/cgit/openstack/horizon/tree/openstack_dashboard/das... With many thanks, /Ian
Hello, During dealing with the following issue in the below e-mail, when I select 'Plural' form and try to save my translation, Zanata gives an error like: "Save FAILED: id 379354, messages: Project or version is read-only". (Screenshot: https://www.dropbox.com/s/xso2gwjswb9she4/Zanata-save_FAILED.png?dl=0 ) For singular form, it works fine. Can't I select plural forms for Korean? And strangely, when I try to use the new alpha editor, I cannot select 'Plural Form'. Am I might not able to find to select 'Plural Form' in the new alpha editor? :) With many thanks, /Ian Ian Y. Choi wrote on 9/16/2016 6:57 PM:
Hello,
Recently, thanks to the help from Andreas, I am investigating on a broken job 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.', count) 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 [1]. 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 '?
[1] http://logs.openstack.org/periodic/horizon-propose-translation-update/c038aa... [2] http://git.openstack.org/cgit/openstack/horizon/tree/openstack_dashboard/das...
With many thanks,
/Ian
Hi Ian, Master is read only until Newton release as usual. Kato
Hello,
During dealing with the following issue in the below e-mail, when I select 'Plural' form and try to save my translation, Zanata gives an error like: "Save FAILED: id 379354, messages: Project or version is read-only".
(Screenshot: https://www.dropbox.com/s/xso2gwjswb9she4/Zanata-save_FAILED.png?dl=0 )
For singular form, it works fine. Can't I select plural forms for Korean?
And strangely, when I try to use the new alpha editor, I cannot select 'Plural Form'. Am I might not able to find to select 'Plural Form' in the new alpha editor? :)
With many thanks,
/Ian
Ian Y. Choi wrote on 9/16/2016 6:57 PM:
Hello,
Recently, thanks to the help from Andreas, I am investigating on a broken job 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.', count) 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 [1]. 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 '?
[1]
http://logs.openstack.org/periodic/horizon-propose-translation-update/c038aa... 92
[2]
http://git.openstack.org/cgit/openstack/horizon/tree/openstack_dashboard/das... te_instance.py#n214
With many thanks,
/Ian
_______________________________________________ OpenStack-I18n mailing list OpenStack-I18n@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-i18n
On 09/16/2016 12:17 PM, Tomoyuki Kato wrote:
Master is read only until Newton release as usual.
That's bad - releasenotes are only in master! If you want to translate releasenotes, I suggest to reconsider, Andreas -- Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
On 09/16/2016 12:45 PM, Tomoyuki Kato wrote:
Master is read only until Newton release as usual.
That's bad - releasenotes are only in master! If you want to translate releasenotes, I suggest to reconsider,
Andreas
Oops, good point. I marked it writable.
Might be worth mentioning on the front page... Andreas -- Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
Hello, stable-newton branch has been just created (thanks, Kato-san!) while I am re-generating the error. Please see the below error message and new screenshot: - Error message : "Save FAILED: id 531170, messages: null" - Screenshot : https://www.dropbox.com/s/zc6uq1c18fz8oim/Zanata-save_FAILED-stable-newton.p... With many thanks, /Ian Kato, Tomoyuki wrote on 9/16/2016 7:17 PM:
Hi Ian,
Master is read only until Newton release as usual.
Kato
Hello,
During dealing with the following issue in the below e-mail, when I select 'Plural' form and try to save my translation, Zanata gives an error like: "Save FAILED: id 379354, messages: Project or version is read-only".
(Screenshot: https://www.dropbox.com/s/xso2gwjswb9she4/Zanata-save_FAILED.png?dl=0 )
For singular form, it works fine. Can't I select plural forms for Korean?
And strangely, when I try to use the new alpha editor, I cannot select 'Plural Form'. Am I might not able to find to select 'Plural Form' in the new alpha editor? :)
With many thanks,
/Ian
Ian Y. Choi wrote on 9/16/2016 6:57 PM:
Hello,
Recently, thanks to the help from Andreas, I am investigating on a broken job 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.', count) 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 [1]. 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 '?
[1]
http://logs.openstack.org/periodic/horizon-propose-translation-update/c038aa... 92
[2]
http://git.openstack.org/cgit/openstack/horizon/tree/openstack_dashboard/das... te_instance.py#n214
With many thanks,
/Ian
_______________________________________________ OpenStack-I18n mailing list OpenStack-I18n@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-i18n
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. What I am not sure is this happens only for languages with nplural==1 (like Korean, Japanese and so on). Akihiro [1] https://www.gnu.org/software/gettext/manual/html_node/Translating-plural-for... [2] https://docs.djangoproject.com/en/1.10/topics/i18n/translation/#pluralizatio... 2016-09-16 18:57 GMT+09:00 Ian Y. Choi <ianyrchoi@gmail.com>:
Hello,
Recently, thanks to the help from Andreas, I am investigating on a broken job 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.', count) 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 [1]. 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 '?
[1] http://logs.openstack.org/periodic/horizon-propose-translation-update/c038aa... [2] http://git.openstack.org/cgit/openstack/horizon/tree/openstack_dashboard/das...
With many thanks,
/Ian
_______________________________________________ OpenStack-I18n mailing list OpenStack-I18n@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-i18n
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, /Ian
What I am not sure is this happens only for languages with nplural==1 (like Korean, Japanese and so on).
Akihiro
[1] https://www.gnu.org/software/gettext/manual/html_node/Translating-plural-for... [2] https://docs.djangoproject.com/en/1.10/topics/i18n/translation/#pluralizatio...
2016-09-16 18:57 GMT+09:00 Ian Y. Choi <ianyrchoi@gmail.com>:
Hello,
Recently, thanks to the help from Andreas, I am investigating on a broken job 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.', count) 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 [1]. 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 '?
[1] http://logs.openstack.org/periodic/horizon-propose-translation-update/c038aa... [2] http://git.openstack.org/cgit/openstack/horizon/tree/openstack_dashboard/das...
With many thanks,
/Ian
_______________________________________________ OpenStack-I18n mailing list OpenStack-I18n@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-i18n
participants (4)
-
Akihiro Motoki
-
Andreas Jaeger
-
Ian Y. Choi
-
Kato, Tomoyuki