Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -458,8 +458,8 @@ |
459 | 459 | edit with 'preview on first edit' enabled. |
460 | 460 | * (bug 6230) Regression fix: <nowiki> in [URL link text] |
461 | 461 | * Added AutoLoader.php, which loads classes without need of require_once() |
| 462 | +* (bug 5981) Add plural function Slovenian (sl) |
462 | 463 | |
463 | | - |
464 | 464 | == Compatibility == |
465 | 465 | |
466 | 466 | MediaWiki 1.7 requires PHP 5 (5.1 recommended). PHP 4 is no longer supported. |
Index: trunk/phase3/languages/LanguageSl.php |
— | — | @@ -190,5 +190,23 @@ |
191 | 191 | return $word; # this will return the original value for 'imenovalnik' (nominativ) and all undefined case values |
192 | 192 | } |
193 | 193 | |
| 194 | + function convertPlural( $count, $w1, $w2, $w3, $w4, $w5) { |
| 195 | + $count = str_replace ('.', '', $count); |
| 196 | + $forms = array( $w1, $w2, $w3, $w4, $w5 ); |
| 197 | + if ( $count % 100 === 1 ) { |
| 198 | + $index = 0; |
| 199 | + } elseif ( $count % 100 === 2 ) { |
| 200 | + $index = 1; |
| 201 | + } elseif ( $count%100==3 || $count%100==4 ) { |
| 202 | + $index = 2; |
| 203 | + } elseif ( $count != 0 ) { |
| 204 | + $index = 3; |
| 205 | + } else { |
| 206 | + $index = 4; |
| 207 | + } |
| 208 | + return $forms[$index]; |
| 209 | + } |
| 210 | + |
| 211 | + |
194 | 212 | } |
195 | 213 | ?> |
\ No newline at end of file |