1da7c6990f89d1dc075bd95986d38b4b00a51911
[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, $wordform1, $wordform2, $wordform3, $wordform4, $w5) {
39 switch ($count % 10) {
40 case 1: return $wordform1;
41 case 2: return $wordform2;
42 case 3: return $wordform3;
43 case 4: return $wordform3;
44 default: return $wordform4;
45 }
46 }
47
48 }
49 ?>