Localization update for he, and several fixes in en.
[lhc/web/wiklou.git] / languages / classes / LanguageBe_tarask.php
1 <?php
2 /** Belarusian in Taraškievica orthography (Беларуская тарашкевіца)
3 *
4 * @ingroup Language
5 *
6 * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
7 * @bug 1638, 2135
8 * @link http://be.wikipedia.org/wiki/Talk:LanguageBe.php
9 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
10 * @license http://www.gnu.org/copyleft/fdl.html GNU Free Documentation License
11 */
12
13 class LanguageBe_tarask extends Language {
14 /**
15 * Plural form transformations
16 *
17 * $wordform1 - singular form (for 1, 21, 31, 41...)
18 * $wordform2 - plural form (for 2, 3, 4, 22, 23, 24, 32, 33, 34...)
19 * $wordform3 - plural form (for 0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 26...)
20 */
21
22 function convertPlural( $count, $forms ) {
23 if ( !count($forms) ) { return ''; }
24
25 //if no number with word, then use $form[0] for singular and $form[1] for plural or zero
26 if( count($forms) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
27
28 $forms = $this->preConvertPlural( $forms, 3 );
29
30 if ($count > 10 && floor(($count % 100) / 10) == 1) {
31 return $forms[2];
32 } else {
33 switch ($count % 10) {
34 case 1: return $forms[0];
35 case 2:
36 case 3:
37 case 4: return $forms[1];
38 default: return $forms[2];
39 }
40 }
41 }
42 }