2 * Ukrainian (Українська) 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( 'uk', '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 ) + 'ника';
47 case 'accusative': // знахідний відмінок
48 if ( ( word
.substr( word
.length
- 4 ) == 'вікі' ) || ( word
.substr( word
.length
- 4 ) == 'Вікі' ) ) {
50 else if ( word
.substr( word
.length
- 2 ) == 'ія' )
51 word
= word
.substr(0, word
.length
- 2 ) + 'ію';