#26123: Wrong Plural-Froms value in the 'ru' locale (regression from version
1.8.x)
-------------------------------------+-------------------------------------
Reporter: generalov | Owner: nobody
Type: Bug | Status: closed
Component: | Version: 1.9
Internationalization |
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by generalov):
Thank you! It's wery interesting case. I've used Django for many years
and `manage.py makemessages -l ru` management command always was generate
the ru/django.po files with npluarls=3 for Russian. I've surpriced by this
change last month.
tldr: It is a strange issue because in the case of nplurals=4 translators
should fill the additional plural form (that CLDR was introduce for
fractions in Russian language) in order to the message take a 'translated'
state. But this form will nether used by Django world, because gettext
advisedly doesn't support fractions in the pluralization functions and
recommends to use the another way to handle them.
It seems there is a difference between CLDR and gettext here.
The CLDR was introduce in the Russian language the forth plural form
('other' category) for fractions:
> In some languages, fractions require a separate category. For example,
Russian 'other' in the example above
http://cldr.unicode.org/index/cldr-spec/plural-rules#TOC-Fractions and
they are note below the "fractions are often a bit tricky".
The Django framework uses the ngettext
https://docs.python.org/3/library/gettext.html that uses GNU gettext (man
3 ngettext) and there is special note about fractions too at
https://www.gnu.org/software/gettext/manual/gettext.html#index-plural-
form-formulas (look at last paragraphs below the languages list). Because
the fractions are often a bit tricky, they are recommend to use the
another way to handle them. The gettext functions advisedly accepts a
decimal positive integers values only (unsigned long int n) for
pluralization and doesn't have any deal with fractions:
{{{
char * ngettext (const char * msgid, const char * msgid_plural,
unsigned long int n);
}}}
gettext po catalog itself uses nplurals=3 for Russian.
https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html .
For example http://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-
runtime/po/ru.po#n19
--
Ticket URL: <https://code.djangoproject.com/ticket/26123#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.fd622ccc334c4f15cc0c0b611ae0cce5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.