ru.js 866 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * Russian (Русский) language functions
  3. */
  4. ( function ( $ ) {
  5. 'use strict';
  6. $.i18n.languages.ru = $.extend( {}, $.i18n.languages[ 'default' ], {
  7. convertGrammar: function ( word, form ) {
  8. if ( form === 'genitive' ) { // родительный падеж
  9. if ( word.slice( -1 ) === 'ь' ) {
  10. word = word.slice( 0, -1 ) + 'я';
  11. } else if ( word.slice( -2 ) === 'ия' ) {
  12. word = word.slice( 0, -2 ) + 'ии';
  13. } else if ( word.slice( -2 ) === 'ка' ) {
  14. word = word.slice( 0, -2 ) + 'ки';
  15. } else if ( word.slice( -2 ) === 'ти' ) {
  16. word = word.slice( 0, -2 ) + 'тей';
  17. } else if ( word.slice( -2 ) === 'ды' ) {
  18. word = word.slice( 0, -2 ) + 'дов';
  19. } else if ( word.slice( -3 ) === 'ник' ) {
  20. word = word.slice( 0, -3 ) + 'ника';
  21. }
  22. }
  23. return word;
  24. }
  25. } );
  26. }( jQuery ) );