Merge "Avoid an infinite redirect in $wgSecureLogin handling"
[lhc/web/wiklou.git] / resources / src / mediawiki.language / languages / uk.js
1 /*!
2 * Ukrainian (Українська) language functions
3 */
4
5 mediaWiki.language.convertGrammar = function ( word, form ) {
6 var grammarForms = mediaWiki.language.getData( 'uk', '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 if ( word.substr( word.length - 1 ) === 'ь' ) {
14 word = word.substr(0, word.length - 1 ) + 'я';
15 } else if ( word.substr( word.length - 2 ) === 'ія' ) {
16 word = word.substr(0, word.length - 2 ) + 'ії';
17 } else if ( word.substr( word.length - 2 ) === 'ка' ) {
18 word = word.substr(0, word.length - 2 ) + 'ки';
19 } else if ( word.substr( word.length - 2 ) === 'ти' ) {
20 word = word.substr(0, word.length - 2 ) + 'тей';
21 } else if ( word.substr( word.length - 2 ) === 'ды' ) {
22 word = word.substr(0, word.length - 2 ) + 'дов';
23 } else if ( word.substr( word.length - 3 ) === 'ник' ) {
24 word = word.substr(0, word.length - 3 ) + 'ника';
25 }
26 }
27 break;
28 case 'accusative': // знахідний відмінок
29 if ( word.substr( word.length - 4 ) !== 'вікі' && word.substr( word.length - 4 ) !== 'Вікі' ) {
30 if ( word.substr( word.length - 2 ) === 'ія' ) {
31 word = word.substr(0, word.length - 2 ) + 'ію';
32 }
33 }
34 break;
35 }
36 return word;
37 };