[Django] #30535: czech translations for "This password is too short. It must contain at least %(min_length)d character." broken in django >= 2.1.0

4 views
Skip to first unread message

Django

unread,
Jun 1, 2019, 8:00:00 AM6/1/19
to django-...@googlegroups.com
#30535: czech translations for "This password is too short. It must contain at
least %(min_length)d character." broken in django >= 2.1.0
----------------------------------------+------------------------
Reporter: Jakub Kaláb | Owner: nobody
Type: Bug | Status: new
Component: contrib.auth | Version: 2.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
----------------------------------------+------------------------
The plural czech translations for "This password is too short. It must
contain at least %(min_length)d character." are broken in django versions
2.1.0 and higher for n >= 5. Can be easily reproduced:

- create django project
- set LANGUAGE_CODE = 'cs-CZ' and USE_I18N = True
- open shell
- import django.utils.translation.ngettext
- run ngettext("This password is too short. It must contain at least
%(min_length)d character.", "This password is too short. It must contain
at least %(min_length)d characters.", 5) - returns original english
message instead of the localized one

Translations for n <= 4 work correctly.

I thing this bug was introduced in
https://github.com/django/django/commit/3e01aab5335394201701710d7fcd67f523878c5b
#diff-59a8943fbf4bd5fd330ef8d22e40bd3f , but am not completely sure, since
the commit was created after the 2.1.0 release. Could this be backported?
Frankly, I'm not even sure why this change was necessary - in czech there
are only 3 forms of the message needed - they differ in the last word
'znak' (which means character) thusly:

- 1 znak
- 2, 3, 4 znaky
- 5 and more znaků and also 0 znaků

I tested this behavior on python 3.6.8 and 3.7.3 and django 2.1.0 and
2.1.8.

--
Ticket URL: <https://code.djangoproject.com/ticket/30535>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 1, 2019, 8:01:40 AM6/1/19
to django-...@googlegroups.com
#30535: czech translations for "This password is too short. It must contain at
least %(min_length)d character." broken in django >= 2.1.0
------------------------------+--------------------------------------

Reporter: Jakub Kaláb | Owner: nobody
Type: Bug | Status: new
Component: contrib.auth | Version: 2.1
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
------------------------------+--------------------------------------
Changes (by Jakub Kaláb):

* Attachment "Screenshot from 2019-06-01 13-43-58.png" added.

screenshot of bug reproduced in django shell

Django

unread,
Jun 1, 2019, 8:26:20 AM6/1/19
to django-...@googlegroups.com
#30535: czech translations for "This password is too short. It must contain at
least %(min_length)d character." broken in django >= 2.1.0
------------------------------+--------------------------------------

Reporter: Jakub Kaláb | Owner: nobody
Type: Bug | Status: new
Component: contrib.auth | Version: 2.1
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
------------------------------+--------------------------------------

Comment (by Jakub Kaláb):

Also, before this is resolved, can anyone please tell me how to override
this? I tried to add the original translations (before linked commit) to
my app, while also adding the much simpler Plural-Forms setting:

"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"

The app is higher then django.contrib.auth in INSTALLED_APPS, but my
override seems to be completely ignored.

--
Ticket URL: <https://code.djangoproject.com/ticket/30535#comment:1>

Django

unread,
Jun 3, 2019, 1:11:23 AM6/3/19
to django-...@googlegroups.com
#30535: Czech plural-forms is incorrect in translations.
-------------------------------------+-------------------------------------

Reporter: Jakub Kaláb | Owner: nobody
Type: Bug | Status: closed
Component: | Version: master
Internationalization |
Severity: Normal | Resolution: invalid

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* status: new => closed
* component: contrib.auth => Internationalization
* version: 2.1 => master
* resolution: => invalid


Comment:

Thanks for the report, however, translations are handled at
[https://docs.djangoproject.com/en/dev/internals/contributing/localizing/#translations.
Transifex] and not in this tracker.

--
Ticket URL: <https://code.djangoproject.com/ticket/30535#comment:2>

Reply all
Reply to author
Forward
0 new messages