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