MediaWiki master
LanguageCu.php
Go to the documentation of this file.
1<?php
7namespace MediaWiki\Languages;
8
12
18class LanguageCu extends Language {
20 public function convertGrammar( $word, $case ) {
21 $grammarForms =
23
24 if ( isset( $grammarForms['сu'][$case][$word] ) ) {
25 return $grammarForms['сu'][$case][$word];
26 }
27
28 # These rules are not perfect, but they are currently only used for
29 # site names, so it doesn't matter if they are wrong sometimes.
30 # Just add a special case for your site name if necessary.
31
32 # join and array_slice instead mb_substr
33 $ar = [];
34 preg_match_all( '/./us', $word, $ar );
35 if ( !preg_match( "/[a-zA-Z_]/u", $word ) ) {
36 switch ( $case ) {
37 case 'genitive': # родительный падеж
38 // if ( ( implode( '', array_slice( $ar[0], -4 ) ) == 'вики' )
39 // || ( implode( '', array_slice( $ar[0], -4 ) ) == 'Вики' )
40 // ) {
41 // }
42
43 if ( implode( '', array_slice( $ar[0], -2 ) ) == 'ї' ) {
44 return implode( '', array_slice( $ar[0], 0, -2 ) ) . 'їѩ';
45 }
46 break;
47 case 'accusative': # винительный падеж
48 # stub
49 break;
50 }
51 }
52
53 return $word;
54 }
55}
56
58class_alias( LanguageCu::class, 'LanguageCu' );
Base class for language-specific code.
Definition Language.php:68
Old Church Slavonic (Ѩзыкъ словѣньскъ)
convertGrammar( $word, $case)
Grammatical transformations, needed for inflected languages Invoked by putting {{grammar:case|word}} ...
A class containing constants representing the names of configuration variables.
const GrammarForms
Name constant for the GrammarForms setting, for use with Config::get()
Service locator for MediaWiki core services.
static getInstance()
Returns the global default instance of the top level service locator.