On Mon, Aug 24, 2020 at 11:32 AM Claude Paroz <cla...@2xlibre.net> wrote:
> Le 24.08.20 à 09:58, אורי a écrit : > > > > On Mon, Aug 24, 2020 at 10:50 AM אורי <u...@speedy.net > > <mailto:u...@speedy.net>> wrote: > > > > Hi Claude, > > > > I'm trying to translate again "%d weeks" for 1 and 2 weeks, and I > > get an error message "The expression '%d' is not present in the > > translation.". I'm not sure if it was saved at all. Why do we need > > "%d" to be present? I wrote the word "one" in Hebrew (שבוע אחד) and > > for 2 weeks there is a special word - שבועיים. Is it possible to > > cancel this check, at least for the numbers 1 and 2? > > > > > > In Hebrew (and probably also English) "one week" looks better than "1 > week". > > There are two possible things at play here: > > 1. A gettext requirement that if the first plural form is not unique, > the %d is mandatory. That seems the case with Hebrew whose plural forms > start with "plural=(n == 1 && n % 1 == 0)" > Why don't just use "n == 1" and "n == 2"? > > 2. An overzealous check by Transifex about that "%d" presence in some > strings (a bug was reported years ago). > > You can check by downloading the .po file, changing your string manually > and then running a msgfmt -vc your_file.po. If gettext complains, you > have no other choice, you have to include the %d placeholder. > msgfmt raises 2 fatal errors for "1 week" and "2 weeks" not containing "%d" (in Hebrew). Anyway this is a bug. What do they do in Arabic? Did you add me to the Arabic and English teams? I checked and the translations to Arabic for "%d weeks" contain "%d" in all the translations, although I think this is a mistake in Arabic, at least for "2 weeks". -- You received this message because you are subscribed to the Google Groups "Django internationalization and localization" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-i18n+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-i18n/CABD5YeFSRO6F4A4SSZi6NnP0GEKcvcjEinUu8GdJ08gZ5-VU9A%40mail.gmail.com.