Files
mediawiki-extensions-Univer…/lib/jquery.i18n/languages/ru.js
Santhosh Thottingal 42deb56323 Update jquery.i18n from upstream
Upstream: https://github.com/wikimedia/jquery.i18n
Upstream changes:
* Fixed a potential js error because of wrong logic
* Fixed some JShint errors
* Added license and credits files
* Updated gitignore file
* Fixed uk and ru grammar rules and updating tests
* Source code formatting updates

Change-Id: I43433cc3d9993045160dc85ed9e73370d22794cf
2013-11-08 16:08:54 +05:30

30 lines
954 B
JavaScript

/**
* Russian (Русский) language functions
*/
( function ( $ ) {
'use strict';
$.i18n.languages.ru = $.extend( {}, $.i18n.languages['default'], {
convertGrammar: function ( word, form ) {
if ( form === 'genitive' ) { // родительный падеж
if ( word.substr( -1 ) === 'ь' ) {
word = word.substr( 0, word.length - 1 ) + 'я';
} else if ( word.substr( -2 ) === 'ия' ) {
word = word.substr( 0, word.length - 2 ) + 'ии';
} else if ( word.substr( -2 ) === 'ка' ) {
word = word.substr( 0, word.length - 2 ) + 'ки';
} else if ( word.substr( -2 ) === 'ти' ) {
word = word.substr( 0, word.length - 2 ) + 'тей';
} else if ( word.substr( -2 ) === 'ды' ) {
word = word.substr( 0, word.length - 2 ) + 'дов';
} else if ( word.substr( -3 ) === 'ник' ) {
word = word.substr( 0, word.length - 3 ) + 'ника';
}
}
return word;
}
} );
}( jQuery ) );