#12903 closed (fixed)
Missing plural forms in admin
Reported by: | Stephane Raimbault | Owned by: | nobody |
---|---|---|---|
Component: | Internationalization | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Two strings are hard to translate, they don't have a plural form:
#: contrib/admin/templates/admin/actions.html:7 #, python-format msgid "" "<span class=\"_acnt\">0</span> of %(total_count)s %(module_name)s selected"
#: contrib/admin/templates/admin/actions.html:11 #, python-format msgid "All %(total_count)s %(module_name)s selected"
Attachments (2)
Change History (11)
comment:1 by , 15 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
follow-up: 3 comment:2 by , 15 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
You're wrong when you say 'if having selected all items, plural.' The plural form depends on the number of items, see http://www.gnu.org/software/hello/manual/gettext/Plural-forms.html for an explanation.
Even more, if all items are selected, I can be only 1 of 1, and the translation becomes incorrect in French, eg. '1 parmi 1 « groupe » sélectionnés' must be '1 parmi 1 « groupe » sélectionné' (final 's' removed and I use French quotes to work around another orthographical problem).
comment:3 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
Replying to stephaner:
You're wrong when you say 'if having selected all items, plural.' The plural form depends on the number of items, see http://www.gnu.org/software/hello/manual/gettext/Plural-forms.html for an explanation.
I'm aware how the plural form works, I just didn't see the special case of having just one item in the list.
Even more, if all items are selected, I can be only 1 of 1, and the translation becomes incorrect in French, eg. '1 parmi 1 « groupe » sélectionnés' must be '1 parmi 1 « groupe » sélectionné' (final 's' removed and I use French quotes to work around another orthographical problem).
Thanks for elaborating with the example, don't hesitate to work on a patch.
comment:4 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:5 by , 15 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
My previous comment wasn't crystal clear, the fix is wrong because the plural form depends of the first argument, the number of selected items between span tag (not the second one, the number of results in the model).
The result in French is now:
1 parmi 5 sélectionnés 2 parmi 5 sélectionnés
but the right translation is:
1 parmi 5 sélectionné (plural form depends on first argument) 2 parmi 5 sélectionnés
The French translation will be even better with:
1 sélectionné parmi 5 2 sélectionnés parmi 5
We must give the full strings to the translators so they will be able to change the word ordering.
It isn't easy to provide the full string because the first argument is modified by Javascript code but may be, the full string could be moved Javascript side.
comment:6 by , 15 years ago
Has patch: | set |
---|
by , 15 years ago
Attachment: | 12903-r12937.diff added |
---|
New version of the patch, fixed a typo and changed method of passing a var from python to JS (hidden span -> JS var)
module_name
already contains verbose_name or verbose_plural_name depending on the number of passed items. The span on line 7 is updated by Javascript so a plural form doesn't help. The note about having all items selected will only occur if having selected all items, plural.