Skip to content

Commit

Permalink
Unit tested romanian plural rules
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jul 21, 2014
1 parent a26efea commit 66a8af3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/I18n/PluralRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public static function calculate($locale, $n) {
($n % 10 >= 2 && $n % 10 <= 4 && ($n % 100 < 10 || $n % 100 >= 20) ? 1 : 2);
case 12:
return $n == 1 ? 0 :
$n == 0 || $n % 100 > 0 && $n % 100 < 20 ? 1 : 2;
($n == 0 || $n % 100 > 0 && $n % 100 < 20 ? 1 : 2);
case 13:
return $n == 0 ? 0 :
$n == 1 ? 1 :
Expand Down
5 changes: 5 additions & 0 deletions tests/TestCase/I18n/PluralRulesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ public function localesProvider() {
['pl', 1, 0],
['pl', 2, 1],
['pl', 101, 2],
['ro', 0, 1],
['ro', 1, 0],
['ro', 2, 1],
['ro', 20, 2],
['ro', 101, 1],
];
}

Expand Down

0 comments on commit 66a8af3

Please sign in to comment.