2 /** Old Church Slavonic (Ѩзыкъ словѣньскъ)
8 /* Please, see Language.php for general function comments */
9 class LanguageCu
extends Language
{
10 # Convert from the nominative form of a noun to some other case
11 # Invoked with {{grammar:case|word}}
12 function convertGrammar( $word, $case ) {
13 global $wgGrammarForms;
14 if ( isset($wgGrammarForms['сu'][$case][$word]) ) {
15 return $wgGrammarForms['сu'][$case][$word];
18 # These rules are not perfect, but they are currently only used for site names so it doesn't
19 # matter if they are wrong sometimes. Just add a special case for your site name if necessary.
21 #join and array_slice instead mb_substr
23 preg_match_all( '/./us', $word, $ar );
24 if (!preg_match("/[a-zA-Z_]/us", $word))
26 case 'genitive': #родительный падеж
27 if ((join('',array_slice($ar[0],-4))=='вики') ||
(join('',array_slice($ar[0],-4))=='Вики'))
29 elseif (join('',array_slice($ar[0],-2))=='ї')
30 $word = join('',array_slice($ar[0],0,-2)).'їѩ';
32 case 'accusative': #винительный падеж
39 function convertPlural( $count, $wordform1, $wordform2, $wordform3, $wordform4, $w5) {
40 switch ($count %
10) {
41 case 1: return $wordform1;
42 case 2: return $wordform2;
43 case 3: return $wordform3;
44 case 4: return $wordform3;
45 default: return $wordform4;