Next bug with plural forms was founded in some languages (Russian for example), where msgstr[0] not necessary is singular form of word. For example in Russian we have "1 nedelya" (1 week), but also have "21 nedelya" (21 week) still for msgstr[0] case. I.e. all cases of msgstr may be use for plurals:

plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)
msgid "1 year"
msgid_plural "%count years"
msgstr[0] "%count god"  - 1, 21, 31, 41 years
msgstr[1] "%count goda"  - 2, 3, 4, 22, 23, 24, 32, 33, 34 and so on
msgstr[2] "%count let" - 0, 5, 6, 7, 8, 9, 10-20, 25-30 and so on...

There are 3 plural forms in Russian. As I know, Slovenian language has 4 plural forms. Yes, we have some complicated rules in Sanskrit-based languages :) Locale.module in 4.5 don't take into account these rules. Solution was sent to me by Basielienis from drupal.ru (see http://drupal.ru/node/324 discussion) - we need correct get_plural() in common.inc. Patch for common.inc below. Problem was discussed with Killes on #drupal and him confirm this solution. Was tested on Russian language and works ok.

CommentFileSizeAuthor
common_9.patch739 bytesaxel
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dries’s picture

Committed to DRUPAL-4-5 and HEAD. Thanks.

Anonymous’s picture