#30439: ngettext broken for certain locales due to catalog merging -------------------------------------+------------------------------------- Reporter: Michal Čihař | Owner: Claude | Paroz Type: Bug | Status: assigned Component: | Version: 2.2 Internationalization | Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by Michal Čihař): It would be necessary to avoid merging of the catalogs and perform lookup over several catalogs. With merging, the lookup in the catalog can not respect plural equation defined in the file. With Czech language I believe this is issue only because of a bug in the plural form (see below), but there are language were several different plural forms are widely used (for example [https://hosted.weblate.org/languages/lv/#information Latvian], where they have same number of plurals, but reverse ordering of the strings in one of them). Going back to Czech locale, the plural equation for Czech (which you apparently got from Transifex) doesn't make sense at all, because it defines 4 plural forms, but it never evaluates to 2 because `n % 1` is always 0: `(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3` So the correct fix here would be revert to original formula and blame Transifex to fix this. Probably some damage was done to the plurals translation meanwhile... PS: I've seen such messed up plurals already in several projects which have decided to migrate from Transifex to [https://weblate.org/ Weblate] (which I develop), not sure if anybody has reported this to them. -- Ticket URL: <https://code.djangoproject.com/ticket/30439#comment:5> 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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/063.2e18159952c0c446503ba6668d7ef1b8%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.