Remove all custom plural rules and use CLDR plural rule system
[lhc/web/wiklou.git] / resources / mediawiki.language / languages / ru.js
1 /**
2 * Russian (Русский) language functions
3 */
4
5 mediaWiki.language.convertGrammar = function( word, form ) {
6 var grammarForms = mw.language.getData( 'ru', 'grammarForms' );
7 if ( grammarForms && grammarForms[form] ) {
8 return grammarForms[form][word] ;
9 }
10 switch ( form ) {
11 case 'genitive': // родительный падеж
12 if ( ( word.substr( word.length - 4 ) == 'вики' ) || ( word.substr( word.length - 4 ) == 'Вики' ) ) {
13 }
14 else if ( word.substr( word.length - 1 ) == 'ь' )
15 word = word.substr(0, word.length - 1 ) + 'я';
16 else if ( word.substr( word.length - 2 ) == 'ия' )
17 word = word.substr(0, word.length - 2 ) + 'ии';
18 else if ( word.substr( word.length - 2 ) == 'ка' )
19 word = word.substr(0, word.length - 2 ) + 'ки';
20 else if ( word.substr( word.length - 2 ) == 'ти' )
21 word = word.substr(0, word.length - 2 ) + 'тей';
22 else if ( word.substr( word.length - 2 ) == 'ды' )
23 word = word.substr(0, word.length - 2 ) + 'дов';
24 else if ( word.substr( word.length - 3 ) == 'ник' )
25 word = word.substr(0, word.length - 3 ) + 'ника';
26 break;
27 }
28 return word;
29 };