This is just a post to report a small inconsistency in drupal localization system.
I may not be clear in the title, but I think this is really wrong:
Some foreign languages have multiple plural forms (1, 2, 3, 4, etc.. will have different writings), and Drupal only handles singular and plural (only 2 ways of writing it), this is bad!
So, I just wandered if handlind plural in a correct way is a planned feature or not. If it's not, you may be should start thinking about it, you already use PO files, which is really great (despite the fact msgid's are english translation, and not an language-independent id, which is problematic if you want to fix a small typo error in english translation, but...).
That's all, thanks in advance for your answers.
Small note: I had to put a single version of drupal, but this is true for *all* versions.
Comments
Comment #1
JirkaRybka commentedAs far as I know, multiple plurals are already supported, although I'm not sure whether they are also well-documented (didn't check). I maintain a Czech site (Czech uses three forms, the singular being re-used even [1 bod, 2 body, 5 bodů, 21 bod, 22 body......]), and it all works like a charm since I first came to Drupal (4.7.x). The translations are a bit "interesting" with the plural-indexes appended to the placeholder-names in the original english strings, but I think it's appropriate solution.
Comment #2
damien tournoud commentedDrupal handles plural forms by the way of standard gettext plural formulas.
Comment #3
pounardThanks!
Ok, my mistake, looking at the format_plural() in Drupal6 did not seems to support it. So where can be found this documentation? I'm really interested about this!
When reading the format_plural() code, and looking at api.drupal.org, all I see is some talkings about the singular form and the plural form (so only two cases), but nothing else. If there is multi plural form support, I would like to know how to use it correctly with Drupal.
I also looked the code with the formulas, because I had a weird bug with plural and french, but I never saw such support when browsing the code!
Thanks in advance for you answers.
Comment #4
damien tournoud commentedHere is it: http://api.drupal.org/api/function/locale_get_plural/6
Plural formula for French is:
nplurals=2; plural=(n > 1), which is obviously different from the English formula, which isnplurals=2; plural=(n = 1) ? 0 : 1.Comment #5
pounardThanks for all your answers, that's what I was looking for.