On 01/26/2016 09:46 PM, Donald Stufft wrote: > >> On Jan 26, 2016, at 3:27 PM, Laurens Van Houtven <_...@lvh.cc> wrote: >> >> Hi Donald, >> >> >> One particular concern is for some Slavic languages and counts. If any of >> your messages has a specific number of things, you need to know what that >> number is to have a correct sentence (e.g. saying “I am 34 years old” and “I >> am 35 years old” has a different grammatical structure; notably, you need to >> know what the number is to know how to spell “years”.). I believe this is >> currently a limitation of gettext, but I also know that in many languages >> gettext is actually gettext + FEATURES, and it’s not clear to me if Python’s >> gettext solves this problem. >> > > > Hey, thanks! That’s great information, and I bet that’s why L20n.js (what > we’re currently using.. but it’s client side so we need to decide if that’s > OK and if it is if the browser support is OK) lets you sort of program your > translations a bit.
Any stats on how many visitors have Javascript turned off? > An example from the L20n website is here > http://l20n.org/learn/putting-it-all-together-complex-plurals-example/ > > I’m not sure how to tell if Python’s gettext supports that. The documentation > says "If a translation is found, apply the plural formula to n, and return > the resulting message (some languages have more than two plural forms).” > which sounds like it might work like that? I found > https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html which > goes way over my head but it mentions Slavic languages so that seems > promising? Gettext's "ngettext" supports one number per message (translation unit), and which is good enough for most UI cases. So you can translate "I'm 34 years old" perfectly, but "remaining time: 5 hours 3 minutes 1 second" is not possible. (The good news is that it's impossible to represent using ngettext, even in English: the translator can't end up with a piece of text that can't be translated well.) _______________________________________________ PSF-Community mailing list PSF-Community@python.org https://mail.python.org/mailman/listinfo/psf-community