| 1 |
|
| 2 |
ions |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
( function ( $ ) { |
| 8 |
'use strict'; |
| 9 |
|
| 10 |
$.i18n.languages.os = $.extend( {}, $.i18n.languages[ 'default' ], { |
| 11 |
convertGrammar: function ( word, form ) { |
| 12 |
var endAllative, jot, hyphen, ending; |
| 13 |
|
| 14 |
|
| 15 |
endAllative = 'мæ'; |
| 16 |
|
| 17 |
jot = ''; |
| 18 |
|
| 19 |
hyphen = ''; |
| 20 |
|
| 21 |
ending = ''; |
| 22 |
|
| 23 |
if ( word.match( /тæ$/i ) ) { |
| 24 |
|
| 25 |
word = word.slice( 0, -1 ); |
| 26 |
endAllative = 'æм'; |
| 27 |
} else if ( word.match( /[аæеёиоыэюя]$/i ) ) { |
| 28 |
|
| 29 |
э, ю, |
| 30 |
. |
| 31 |
jot = 'й'; |
| 32 |
} else if ( word.match( /у$/i ) ) { |
| 33 |
or |
| 34 |
|
| 35 |
унеуы, |
| 36 |
æппуйы. |
| 37 |
if ( !word.slice( -2, -1 ).match( /[аæеёиоыэюя]$/i ) ) { |
| 38 |
jot = 'й'; |
| 39 |
} |
| 40 |
} else if ( !word.match( /[бвгджзйклмнопрстфхцчшщьъ]$/i ) ) { |
| 41 |
hyphen = '-'; |
| 42 |
} |
| 43 |
|
| 44 |
switch ( form ) { |
| 45 |
case 'genitive': |
| 46 |
ending = hyphen + jot + 'ы'; |
| 47 |
break; |
| 48 |
case 'dative': |
| 49 |
ending = hyphen + jot + 'æн'; |
| 50 |
break; |
| 51 |
case 'allative': |
| 52 |
ending = hyphen + endAllative; |
| 53 |
break; |
| 54 |
case 'ablative': |
| 55 |
if ( jot === 'й' ) { |
| 56 |
ending = hyphen + jot + 'æ'; |
| 57 |
} else { |
| 58 |
ending = hyphen + jot + 'æй'; |
| 59 |
} |
| 60 |
break; |
| 61 |
case 'superessive': |
| 62 |
ending = hyphen + jot + 'ыл'; |
| 63 |
break; |
| 64 |
case 'equative': |
| 65 |
ending = hyphen + jot + 'ау'; |
| 66 |
break; |
| 67 |
case 'comitative': |
| 68 |
ending = hyphen + 'имæ'; |
| 69 |
break; |
| 70 |
} |
| 71 |
|
| 72 |
return word + ending; |
| 73 |
} |
| 74 |
} ); |
| 75 |
}( jQuery ) ); |