Merge "(bug 37755) Set robot meta tags for 'view source' pages"
[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 /*jshint noempty:false, onecase:true */
7 var grammarForms = mediaWiki.language.getData( 'ru', 'grammarForms' );
8 if ( grammarForms && grammarForms[form] ) {
9 return grammarForms[form][word];
10 }
11 switch ( form ) {
12 case 'genitive': // родительный падеж
13 if ( ( word.substr( word.length - 4 ) === 'вики' ) || ( word.substr( word.length - 4 ) === 'Вики' ) ) {
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 }
27 break;
28 }
29 return word;
30 };