Merge "New helper ApiTestCase::setExpectedApiException()"
[lhc/web/wiklou.git] / resources / lib / jquery.i18n / src / languages / os.js
1 /**
2 * Ossetian (Ирон) language functions
3 *
4 * @author Santhosh Thottingal
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 // Ending for allative case
15 endAllative = 'мæ';
16 // Variable for 'j' beetwen vowels
17 jot = '';
18 // Variable for "-" for not Ossetic words
19 hyphen = '';
20 // Variable for ending
21 ending = '';
22
23 if ( word.match( /тæ$/i ) ) {
24 // Checking if the $word is in plural form
25 word = word.slice( 0, -1 );
26 endAllative = 'æм';
27 } else if ( word.match( /[аæеёиоыэюя]$/i ) ) {
28 // Works if word is in singular form.
29 // Checking if word ends on one of the vowels: е, ё, и, о, ы, э, ю,
30 // я.
31 jot = 'й';
32 } else if ( word.match( /у$/i ) ) {
33 // Checking if word ends on 'у'. 'У' can be either consonant 'W' or
34 // vowel 'U' in cyrillic Ossetic.
35 // Examples: {{grammar:genitive|аунеу}} = аунеуы,
36 // {{grammar:genitive|лæппу}} = лæппуйы.
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 ) );