remove EOL whitespace, and excess empty lines
[lhc/web/wiklou.git] / languages / classes / LanguageCu.php
1 <?php
2 /** Old Church Slavonic (Ѩзыкъ словѣньскъ)
3 *
4 * @addtogroup Language
5 */
6
7 /* Please, see Language.php for general function comments */
8 class LanguageCu extends Language {
9 # Convert from the nominative form of a noun to some other case
10 # Invoked with {{grammar:case|word}}
11 function convertGrammar( $word, $case ) {
12 global $wgGrammarForms;
13 if ( isset($wgGrammarForms['сu'][$case][$word]) ) {
14 return $wgGrammarForms['сu'][$case][$word];
15 }
16
17 # These rules are not perfect, but they are currently only used for site names so it doesn't
18 # matter if they are wrong sometimes. Just add a special case for your site name if necessary.
19
20 #join and array_slice instead mb_substr
21 $ar = array();
22 preg_match_all( '/./us', $word, $ar );
23 if (!preg_match("/[a-zA-Z_]/us", $word))
24 switch ( $case ) {
25 case 'genitive': #родительный падеж
26 if ((join('',array_slice($ar[0],-4))=='вики') || (join('',array_slice($ar[0],-4))=='Вики'))
27 {}
28 elseif (join('',array_slice($ar[0],-2))=='ї')
29 $word = join('',array_slice($ar[0],0,-2)).'їѩ';
30 break;
31 case 'accusative': #винительный падеж
32 #stub
33 break;
34 }
35 return $word;
36 }
37
38 function convertPlural( $count, $forms ) {
39 if ( !count($forms) ) { return ''; }
40 $forms = $this->preConvertPlural( $forms, 4 );
41
42 switch ($count % 10) {
43 case 1: return $forms[0];
44 case 2: return $forms[1];
45 case 3:
46 case 4: return $forms[2];
47 default: return $forms[3];
48 }
49 }
50 }