Index: trunk/phase3/languages/classes/LanguageGd.php |
— | — | @@ -4,32 +4,39 @@ |
5 | 5 | * @ingroup Language |
6 | 6 | * |
7 | 7 | * @author Raimond Spekking |
| 8 | + * @author Niklas Laxström |
8 | 9 | */ |
9 | 10 | class LanguageGd extends Language { |
10 | 11 | |
11 | 12 | /** |
12 | 13 | * Plural form transformations |
13 | | - * Based on this discussion: http://translatewiki.net/w/i.php?title=Portal_talk:Gd&oldid=1094065#%C3%80ireamhan |
| 14 | + * Based on this discussion: http://translatewiki.net/wiki/Thread:Support/New_plural_rules_for_Scots_Gaelic_(gd) |
14 | 15 | * |
15 | | - * $forms[0] - singular form (for 1) |
16 | | - * $forms[1] - dual form (for 2) |
17 | | - * $forms[2] - plural form 1 (for 3-10) |
18 | | - * $forms[3] - plural form 2 (for >= 11) |
| 16 | + * $forms[0] - 1 |
| 17 | + * $forms[1] - 2 |
| 18 | + * $forms[2] - 11 |
| 19 | + * $forms[3] - 12 |
| 20 | + * $forms[4] - 3-10, 13-19 |
| 21 | + * $forms[5] - 0, 20, rest |
19 | 22 | * |
20 | 23 | */ |
21 | 24 | function convertPlural( $count, $forms ) { |
22 | 25 | if ( !count( $forms ) ) { return ''; } |
23 | | - $forms = $this->preConvertPlural( $forms, 4 ); |
| 26 | + $forms = $this->preConvertPlural( $forms, 6 ); |
24 | 27 | |
25 | 28 | $count = abs( $count ); |
26 | 29 | if ( $count === 1 ) { |
27 | 30 | return $forms[0]; |
28 | 31 | } elseif ( $count === 2 ) { |
29 | 32 | return $forms[1]; |
30 | | - } elseif ( $count >= 3 && $count <= 10 ) { |
| 33 | + } elseif ( $count === 11 ) { |
31 | 34 | return $forms[2]; |
| 35 | + } elseif ( $count === 12 ) { |
| 36 | + return $forms[3]; |
| 37 | + } elseif ( ($count >= 3 && $count <= 10) || ($count >= 13 && $count <= 19) ) { |
| 38 | + return $forms[4]; |
32 | 39 | } else { |
33 | | - return $forms[3]; |
| 40 | + return $forms[5]; |
34 | 41 | } |
35 | 42 | } |
36 | 43 | } |