Skip to content

Commit

Permalink
Fix plural calculation for Icelandic.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Dec 7, 2014
1 parent c5e32f2 commit d9f3e86
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/I18n/PluralRules.php
Expand Up @@ -66,7 +66,7 @@ class PluralRules {
'hr' => 3,
'hu' => 1,
'id' => 0,
'is' => 1,
'is' => 15,
'it' => 1,
'ja' => 0,
'jv' => 0,
Expand Down Expand Up @@ -191,6 +191,8 @@ public static function calculate($locale, $n) {
return $n == 1 ? 0 :
($n == 2 ? 1 :
($n != 8 && $n != 11 ? 2 : 3));
case 15:
return ($n % 10 != 1 || $n % 100 == 11) ? 1 : 0;
}
}

Expand Down
5 changes: 5 additions & 0 deletions tests/TestCase/I18n/PluralRulesTest.php
Expand Up @@ -61,6 +61,11 @@ public function localesProvider() {
['ga', 2, 1],
['ga', 7, 3],
['ga', 11, 4],
['is', 1, 0],
['is', 2, 1],
['is', 3, 1],
['is', 11, 1],
['is', 21, 0],
['lt', 0, 2],
['lt', 1, 0],
['lt', 2, 1],
Expand Down

0 comments on commit d9f3e86

Please sign in to comment.