* Fix an invalid XHTML (strict) on images
[mediawiki.git] / languages / classes / LanguageCu.php
blobfba895ecbf7227a7184c2890c32217c323edcbcf
1 <?php
2 /** Old Church Slavonic (Ѩзыкъ словѣньскъ)
4 * @addtogroup Language
5 */
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];
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.
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))=='Вики'))
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;
35 return $word;
38 function convertPlural( $count, $forms ) {
39 if ( !count($forms) ) { return ''; }
40 $forms = $this->preConvertPlural( $forms, 4 );
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];