Skip to content

Commit

Permalink
Fixing plural rules for macedonian
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jul 21, 2014
1 parent 10cd91e commit e7b0dd1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/I18n/PluralRules.php
Expand Up @@ -167,7 +167,7 @@ public static function calculate($locale, $n) {
return $n % 100 == 1 ? 1 :
($n % 100 == 2 ? 2 : ($n % 100 == 3 || $n % 100 == 4 ? 3 : 0));
case 8:
return $n % 10 == 1 ? 0 : 1;
return $n % 10 == 1 ? 0 : ($n % 10 == 2 ? 1 : 2);
case 9:
return $n == 1 ? 0 :
$n == 0 || ($n % 100 > 0 && $n % 100 <= 10) ? 1 :
Expand Down
6 changes: 5 additions & 1 deletion tests/TestCase/I18n/PluralRulesTest.php
Expand Up @@ -66,7 +66,11 @@ public function localesProvider() {
['sl', 3, 3],
['sl', 10, 0],
['sl', 101, 1],
['sl', 103, 3]
['sl', 103, 3],
['mk', 0, 2],
['mk', 1, 0],
['mk', 13, 2],
['mk', 21, 0]
];
}

Expand Down

0 comments on commit e7b0dd1

Please sign in to comment.