#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: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 --------------------------------------+------------------------------------
Comment (by Michal Čihař): Replying to [comment:16 Rodrigo]: > Then functions like [https://github.com/django/django/blob/master/django/core/management/commands/makemessages.py#L633 copy_plural_forms] should get it from there, and when syncin', either overwrite it or generate an empty one and do a msgmerge. Overwriting plural form will mess up existing translations. > If you generate and compile the messages using the django-admin commands, there would be no problem, I think the case you are referring is when you put "pos and mos" from external sources - like a translation platform, which for convenience may use less plurals than the corresponding or specified for the languange - in locale dirs which have a different plural forms than the one coming with Django, which is not supported. The current mess was started by Transifex, which is AFAIK Django official localization platform. I don't think they support honoring plural forms existing in the file, they always rewrite to whatever they have hardcoded. > Then the ticket would be "Add support for variable number of plural forms in Django in order to support different translations platforms outputs", do you agree? True, I didn't notice this is covered in the docs. However, in such case Django should not unadvertised change plural forms in existing translations. > > I still don't understand why Django has the wrong approach, because a language should have only one number of plurals and one plural equation. Once it is right, if you provide less than specified, then it's incomplete. I noticed it on Czech where Django has wrong plural form (see above, it can never evaluate to 2, so even if it defines 4 plurals, one of them is never used). Still, there might be valid reason to have different plural forms and equations in different scope. I do have quite some insight into this because I develop [https://weblate.org/ Weblate] (using Django), where we put quite some effort to handle plural forms correctly :-). The earlier mentioned example of [https://hosted.weblate.org/languages/he/#information Hebrew] can be seen on our public hosting service - 25% of translations use simple two plurals and 75% use more complex four plurals. Both are correct and in many cases the one with two plural forms is working well at it makes it easier for translators. Another example where things would be messed up with current Django implementation is Lithuanian, see https://github.com/WeblateOrg/weblate/issues/901 for discussion we had on this at Weblate. -- Ticket URL: <https://code.djangoproject.com/ticket/30439#comment:22> 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.bfe8868f53cb3a09eaf54ce45be8b06c%40djangoproject.com.