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