2 * Russian (Русский) language functions
5 mediaWiki.language.convertPlural = function( count, forms ) {
6 if ( forms.length === 2 ) {
7 return count == 1 ? forms[0] : forms[1];
9 forms = mediaWiki.language.preConvertPlural( forms, 3 );
10 if ( count > 10 && Math.floor( ( count % 100 ) / 10 ) == 1 ) {
13 switch ( count % 10 ) {
25 mediaWiki.language.convertGrammar = function( word, form ) {
26 var grammarForms = mw.language.getData( 'ru', 'grammarForms' );
27 if ( grammarForms && grammarForms[form] ) {
28 return grammarForms[form][word] ;
31 case 'genitive': // родительный падеж
32 if ( ( word.substr( word.length - 4 ) == 'вики' ) || ( word.substr( word.length - 4 ) == 'Вики' ) ) {
34 else if ( word.substr( word.length - 1 ) == 'ь' )
35 word = word.substr(0, word.length - 1 ) + 'я';
36 else if ( word.substr( word.length - 2 ) == 'ия' )
37 word = word.substr(0, word.length - 2 ) + 'ии';
38 else if ( word.substr( word.length - 2 ) == 'ка' )
39 word = word.substr(0, word.length - 2 ) + 'ки';
40 else if ( word.substr( word.length - 2 ) == 'ти' )
41 word = word.substr(0, word.length - 2 ) + 'тей';
42 else if ( word.substr( word.length - 2 ) == 'ды' )
43 word = word.substr(0, word.length - 2 ) + 'дов';
44 else if ( word.substr( word.length - 3 ) == 'ник' )
45 word = word.substr(0, word.length - 3 ) + 'ника';