Hi Claude, Thanks for the explanation, I understand the problem better now. I was not aware that the number of singular and plural forms depends on the language. I would like to clarify a few things:
1. Some of the strings used by "ngettext" or "ngettext_lazy" are unique to Speedy Net, some are not. Anyway I added translations for all of them in the Speedy Net django.po files, for the case that if Django will change the strings, they will still be translated. 2. When running ./make_all_messages.sh in Django 2.2, which runs make_messages for the locales en and he, nothing changes in the django.po files (except the date) - a third and fourth line are not added. 3. I think Django should handle django.po files when there are only 2 forms - singular and plural - and use the same plural forms for all forms of plurals, whatever that means. And in many cases the plural forms are identical, as I found out for example in https://github.com/django/django/blob/master/django/contrib/auth/locale/he/LC_MESSAGES/django.po#L223-L233. Actually from my knowledge of Hebrew, in most cases the plural form is the same for all numbers. In my case for example, Speedy Net, I only use plural although the singular is defined. I just copied the definition from Django validators with "ngettext_lazy" included. So I think there should be a fallback, so if only 2 forms are defined - singular and plural - then Django should use the same plural form for all plurals. This will also provide a backward compatibility to previous versions of Django. 4. Everything worked for me with Django versions up to 2.1. I think if such a big change is introduced to Django, which is not backward compatible, then new functions should be introduced by leaving "ngettext" or "ngettext_lazy" as they are. Or at least there should be some setting to allow backward compatibility. Especially since updating the django.po files might cause problems when downgrading to previous versions of Django, which don't support it. 5. If running make_messages will introduce 2 more plural forms in the django.po files, I expect the new forms to default to the plural form currently defined, to allow backward compatibility. And also, these functions should work when downgrading to a previous version of Django. 6. I never used Transifex directly. I only use Django. I never even heard about Transifex until today. Django developers can do whatever they want with third party dependencies. What matters to me is how Django works. Thanks, אורי [email protected] On Fri, Nov 1, 2019 at 9:29 PM Claude Paroz <[email protected]> wrote: > Hi Uri, > > I think you did not understand well the problem. Let me try to explain it > in more details. > > Nothing was changed with "ngettext" or "ngettext_lazy" in Django. The > plural equation for Hebrew was changed on the Transifex platform and those > changes reach Django each time we synchronize translations with Transifex > (a script-driven process). Note that it was the case for some other > languages too. > > The plural equation defines how many different plural forms can exist for > any language. English has two, Arabic has six, etc. > Apparently, someone discovered/decided that Hebrew can have 4 different > plurals in certain cases, that's probably why Transifex changed it, but I > cannot tell you more about the rationales. By reading the new Hebrew > equation, it looks like the plural can be different if the number is 1, 2, > (20, 30, 40, etc.), or anything else. > > The problem with Django, which is the object of #30439, is that Django is > using only the plural equation of the core django.po file, so if you have > several .po files with different plural equations, the plural may be wrong > or can fallback to English. Typically in your case, the core Django po file > has an equation with 4 plurals, while your Speedy.net po file has only 2, > so when the translation infrastruction is looking for the 3rd or 4th form, > it finds nothing and return the English string. You should be able to fix > that by re-doing a makemessages in your project in a Django 2.2 > environment, and you should find that your updated po file will have 4 > plurals for each plural string (but then running your project with older > Django versions can have translation problems again :-( ). > > Hopefully someone will have the time to prepare a patch to solve #30429 in > order that plural string changes can be easily managed. > > Regards, > > Claude > > t > >> -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-developers/9d8ade17-3d6e-46dc-8ad7-a6b27de90593%40googlegroups.com > <https://groups.google.com/d/msgid/django-developers/9d8ade17-3d6e-46dc-8ad7-a6b27de90593%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CABD5YeFVwrSUz0VoAZ6wvET%2BJDM%2BkF%2B%3DypPYpfjagHnOrhwx%3Dw%40mail.gmail.com.
