Makes convertPlural compatible (strict standards)
[lhc/web/wiklou.git] / languages / classes / LanguageCu.php
1 <?php
2 /** Old Church Slavonic (Ѩзыкъ словѣньскъ)
3 *
4 * @package MediaWiki
5 * @subpackage Language
6 */
7
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];
16 }
17
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.
20
21 #join and array_slice instead mb_substr
22 $ar = array();
23 preg_match_all( '/./us', $word, $ar );
24 if (!preg_match("/[a-zA-Z_]/us", $word))
25 switch ( $case ) {
26 case 'genitive': #родительный падеж
27 if ((join('',array_slice($ar[0],-4))=='вики') || (join('',array_slice($ar[0],-4))=='Вики'))
28 {}
29 elseif (join('',array_slice($ar[0],-2))=='ї')
30 $word = join('',array_slice($ar[0],0,-2)).'їѩ';
31 break;
32 case 'accusative': #винительный падеж
33 #stub
34 break;
35 }
36 return $word;
37 }
38
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;
46 }
47 }
48
49 }
50 ?>