#30439: Translations issues on Django upgrade due to unexpected changes in plural forms --------------------------------------+------------------------------------ Reporter: Michal Čihař | Owner: Rodrigo Type: Bug | Status: assigned Component: Internationalization | Version: 2.2 Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 --------------------------------------+------------------------------------
Comment (by Rodrigo): Replying to [comment:33 אורי]: > Replying to [comment:32 Rodrigo]: > > [https://github.com/django/django/pull/12280 PR] > > Can you explain how this PR solves this issue? There are so many changed files in this PR so it's difficult for me to understand what has been changed in it. Here is the doc: - [https://github.com/math- a3k/django/commit/8b5397fba6f97db4fd299e2ad7516deb403685e1#diff- 71461bf83587a4ca9617ddc8761a5908R282 Plural forms] - [https://github.com/math- a3k/django/commit/8b5397fba6f97db4fd299e2ad7516deb403685e1#diff- 7432e7141e58a9eede9760904be4b14cR1955 LOCALE_ROOT] - [https://github.com/math- a3k/django/commit/8b5397fba6f97db4fd299e2ad7516deb403685e1#diff- b5ea25a58e9c8adf1a328182844020caR731 --collect-base-catalogs & --comply- plural-forms] The plural form consistency is ensured in two ways: - The "not-merge" policy in DjangoTranslation - The [https://github.com/math- a3k/django/commit/8b5397fba6f97db4fd299e2ad7516deb403685e1#diff- 66419ea224251c19c4132df83756af08R1819 catalog consistency test] will check that any catalog introduced in the base catalogs will have the same plural form as the main one for the lang, or, if a change in the plural form is made, all the catalogs for the lang must be updated (this is done with makemessages --comply-plural-forms). This is done at a CI level. So, there won't be different plural forms in Django catalogs anymore (the original report by Michal). Once a change in the main plural forms gets to the user, the user will see [https://github.com/math- a3k/django/commit/8b5397fba6f97db4fd299e2ad7516deb403685e1#diff- 5682903b7aed1649cdb7095331e90d0dR209 this warning]. Then, they have the two options: - running "makemessages --comply-plural-forms" to incorporate the new forms to their catalogs, or - use the LOCALE_ROOT setting for using their plural forms. If they go with --comply-plural-forms, as the doc say, "In the case of an increase in the number of plurals, it will fill those with the previously chosen forms so you avoid having translation results in the fallback language or the original string - this will produce the same results as before though you may want to update those later for a better expression of the language if it corresponds." ... "If no plural forms is found in the catalog, the user will be prompted to copy them from the main po file. No remapping will be done, it is assumed that is already aligned. If it is not the case, use a plural form with the number of plurals matching the catalog and then re-run the command to perform form mapping". This way, any update on Django's plural forms won't break translations in user projects. The user should see the warning once they run the project after the update. If they just update it without checking, they will see "big parts" untranslated (the catalogs not merged) which will lead them to the logs and see the warning, then run --comply-plural-forms. If they go with the LOCALE_ROOT, they can collect the base catalogs with "makemessages --collect-base-catalogs" (cbc), customize the plural forms and then run "makemessages --comply-plural-forms" to "propagate" the form to the project's catalogs. Once Django is updated another time, they won't see any warning, it's up to them to call again (cbc) so they get the new msgids incorporated in Django. With this setup, you will have a way of propagating updates in the plural forms consistently and the option to have your plural forms locally. > Which version of Django this PR will be included in if accepted? Not sure, is targeted for 3.1 -- Ticket URL: <https://code.djangoproject.com/ticket/30439#comment:34> 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 view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/063.afaaad1bd34bd1faa85dd0b52ad50085%40djangoproject.com.