diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-01-18 16:46:04 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-01-18 16:46:04 +0100 |
commit | 63601400e476c6cf43d985f3e7b9864681695ed4 (patch) | |
tree | f7846203a952e38aaf66989d0a4702779f549962 /resources/mediawiki.language/languages/uk.js | |
parent | 8ff01378c9e0207f9169b81966a51def645b6a51 (diff) |
Update to MediaWiki 1.20.2
this update includes:
* adjusted Arch Linux skin
* updated FluxBBAuthPlugin
* patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024
Diffstat (limited to 'resources/mediawiki.language/languages/uk.js')
-rw-r--r-- | resources/mediawiki.language/languages/uk.js | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/resources/mediawiki.language/languages/uk.js b/resources/mediawiki.language/languages/uk.js index 5c1294e7..ee110b06 100644 --- a/resources/mediawiki.language/languages/uk.js +++ b/resources/mediawiki.language/languages/uk.js @@ -2,22 +2,34 @@ * Ukrainian (Українська) language functions */ -mediaWiki.language.convertPlural = function( count, forms ) { - if ( forms.length === 2 ) { - return count == 1 ? forms[0] : forms[1]; +mediaWiki.language.convertGrammar = function( word, form ) { + var grammarForms = mw.language.getData( 'uk', 'grammarForms' ); + if ( grammarForms && grammarForms[form] ) { + return grammarForms[form][word] ; } - forms = mediaWiki.language.preConvertPlural( forms, 3 ); - if ( count > 10 && Math.floor( ( count % 100 ) / 10 ) == 1 ) { - return forms[2]; - } - switch ( count % 10 ) { - case 1: - return forms[0]; - case 2: - case 3: - case 4: - return forms[1]; - default: - return forms[2]; + switch ( form ) { + case 'genitive': // родовий відмінок + if ( ( word.substr( word.length - 4 ) == 'вікі' ) || ( word.substr( word.length - 4 ) == 'Вікі' ) ) { + } + else if ( word.substr( word.length - 1 ) == 'ь' ) + word = word.substr(0, word.length - 1 ) + 'я'; + else if ( word.substr( word.length - 2 ) == 'ія' ) + word = word.substr(0, word.length - 2 ) + 'ії'; + else if ( word.substr( word.length - 2 ) == 'ка' ) + word = word.substr(0, word.length - 2 ) + 'ки'; + else if ( word.substr( word.length - 2 ) == 'ти' ) + word = word.substr(0, word.length - 2 ) + 'тей'; + else if ( word.substr( word.length - 2 ) == 'ды' ) + word = word.substr(0, word.length - 2 ) + 'дов'; + else if ( word.substr( word.length - 3 ) == 'ник' ) + word = word.substr(0, word.length - 3 ) + 'ника'; + break; + case 'accusative': // знахідний відмінок + if ( ( word.substr( word.length - 4 ) == 'вікі' ) || ( word.substr( word.length - 4 ) == 'Вікі' ) ) { + } + else if ( word.substr( word.length - 2 ) == 'ія' ) + word = word.substr(0, word.length - 2 ) + 'ію'; + break; } + return word; }; |