Merge "Revert "Convert Special:Search to OOUI""
[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.substring( 0, word.length - 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.substring( word.length - 2, word.length - 1 )
38 .match( /[аæеёиоыэюя]$/i ) ) {
39 jot = 'й';
40 }
41 } else if ( !word.match( /[бвгджзйклмнопрстфхцчшщьъ]$/i ) ) {
42 hyphen = '-';
43 }
44
45 switch ( form ) {
46 case 'genitive':
47 ending = hyphen + jot + 'ы';
48 break;
49 case 'dative':
50 ending = hyphen + jot + 'æн';
51 break;
52 case 'allative':
53 ending = hyphen + endAllative;
54 break;
55 case 'ablative':
56 if ( jot === 'й' ) {
57 ending = hyphen + jot + 'æ';
58 } else {
59 ending = hyphen + jot + 'æй';
60 }
61 break;
62 case 'superessive':
63 ending = hyphen + jot + 'ыл';
64 break;
65 case 'equative':
66 ending = hyphen + jot + 'ау';
67 break;
68 case 'comitative':
69 ending = hyphen + 'имæ';
70 break;
71 }
72
73 return word + ending;
74 }
75 } );
76 }( jQuery ) );