Remove jquery.i18n code that the ULS extension overrides
Instead of using the whole jquery.i18n code, use only required parts that are not customized in MW ULS. For this define a new RL module ext.uls.i18n. Also refactor MW message store for jquery.i18n. Change-Id: Idda9fe505428ade409d937314d7216ebb4232c36
This commit is contained in:
committed by
Amire80
parent
a14f941f48
commit
28154206bf
22
lib/jquery.i18n/languages/bs.js
Normal file
22
lib/jquery.i18n/languages/bs.js
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Bosnian (bosanski) language functions
|
||||
*/
|
||||
( function ( $ ) {
|
||||
'use strict';
|
||||
|
||||
$.i18n.languages.bs = $.extend( {}, $.i18n.languages['default'], {
|
||||
convertGrammar: function ( word, form ) {
|
||||
switch ( form ) {
|
||||
case 'instrumental': // instrumental
|
||||
word = 's ' + word;
|
||||
break;
|
||||
case 'lokativ': // locative
|
||||
word = 'o ' + word;
|
||||
break;
|
||||
}
|
||||
|
||||
return word;
|
||||
}
|
||||
} );
|
||||
|
||||
}( jQuery ) );
|
||||
22
lib/jquery.i18n/languages/dsb.js
Normal file
22
lib/jquery.i18n/languages/dsb.js
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Lower Sorbian (Dolnoserbski) language functions
|
||||
*/
|
||||
( function ( $ ) {
|
||||
'use strict';
|
||||
|
||||
$.i18n.languages.dsb = $.extend( {}, $.i18n.languages['default'], {
|
||||
convertGrammar: function ( word, form ) {
|
||||
switch ( form ) {
|
||||
case 'instrumental': // instrumental
|
||||
word = 'z ' + word;
|
||||
break;
|
||||
case 'lokatiw': // lokatiw
|
||||
word = 'wo ' + word;
|
||||
break;
|
||||
}
|
||||
|
||||
return word;
|
||||
}
|
||||
} );
|
||||
|
||||
}( jQuery ) );
|
||||
49
lib/jquery.i18n/languages/fi.js
Normal file
49
lib/jquery.i18n/languages/fi.js
Normal file
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Finnish (Suomi) language functions
|
||||
*
|
||||
* @author Santhosh Thottingal
|
||||
*/
|
||||
|
||||
( function ( $ ) {
|
||||
'use strict';
|
||||
|
||||
$.i18n.languages.fi = $.extend( {}, $.i18n.languages['default'], {
|
||||
convertGrammar: function ( word, form ) {
|
||||
// vowel harmony flag
|
||||
var aou = word.match( /[aou][^äöy]*$/i ),
|
||||
origWord = word;
|
||||
if ( word.match( /wiki$/i ) ) {
|
||||
aou = false;
|
||||
}
|
||||
|
||||
// append i after final consonant
|
||||
if ( word.match( /[bcdfghjklmnpqrstvwxz]$/i ) ) {
|
||||
word += 'i';
|
||||
}
|
||||
|
||||
switch ( form ) {
|
||||
case 'genitive':
|
||||
word += 'n';
|
||||
break;
|
||||
case 'elative':
|
||||
word += ( aou ? 'sta' : 'stä' );
|
||||
break;
|
||||
case 'partitive':
|
||||
word += ( aou ? 'a' : 'ä' );
|
||||
break;
|
||||
case 'illative':
|
||||
// Double the last letter and add 'n'
|
||||
word += word.substr( word.length - 1 ) + 'n';
|
||||
break;
|
||||
case 'inessive':
|
||||
word += ( aou ? 'ssa' : 'ssä' );
|
||||
break;
|
||||
default:
|
||||
word = origWord;
|
||||
break;
|
||||
}
|
||||
|
||||
return word;
|
||||
}
|
||||
} );
|
||||
}( jQuery ) );
|
||||
38
lib/jquery.i18n/languages/ga.js
Normal file
38
lib/jquery.i18n/languages/ga.js
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Irish (Gaeilge) language functions
|
||||
*/
|
||||
( function ( $ ) {
|
||||
'use strict';
|
||||
|
||||
$.i18n.languages.ga = $.extend( {}, $.i18n.languages['default'], {
|
||||
convertGrammar: function ( word, form ) {
|
||||
if ( form === 'ainmlae' ) {
|
||||
switch ( word ) {
|
||||
case 'an Domhnach':
|
||||
word = 'Dé Domhnaigh';
|
||||
break;
|
||||
case 'an Luan':
|
||||
word = 'Dé Luain';
|
||||
break;
|
||||
case 'an Mháirt':
|
||||
word = 'Dé Mháirt';
|
||||
break;
|
||||
case 'an Chéadaoin':
|
||||
word = 'Dé Chéadaoin';
|
||||
break;
|
||||
case 'an Déardaoin':
|
||||
word = 'Déardaoin';
|
||||
break;
|
||||
case 'an Aoine':
|
||||
word = 'Dé hAoine';
|
||||
break;
|
||||
case 'an Satharn':
|
||||
word = 'Dé Sathairn';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return word;
|
||||
}
|
||||
} );
|
||||
}( jQuery ) );
|
||||
31
lib/jquery.i18n/languages/he.js
Normal file
31
lib/jquery.i18n/languages/he.js
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Hebrew (עברית) language functions
|
||||
*/
|
||||
( function ( $ ) {
|
||||
'use strict';
|
||||
|
||||
$.i18n.languages.he = $.extend( {}, $.i18n.languages['default'], {
|
||||
convertGrammar: function ( word, form ) {
|
||||
switch ( form ) {
|
||||
case 'prefixed':
|
||||
case 'תחילית': // the same word in Hebrew
|
||||
// Duplicate prefixed "Waw", but only if it's not already double
|
||||
if ( word.substr( 0, 1 ) === 'ו' && word.substr( 0, 2 ) !== 'וו' ) {
|
||||
word = 'ו' + word;
|
||||
}
|
||||
|
||||
// Remove the "He" if prefixed
|
||||
if ( word.substr( 0, 1 ) === 'ה' ) {
|
||||
word = word.substr( 1, word.length );
|
||||
}
|
||||
|
||||
// Add a hyphen (maqaf) before numbers and non-Hebrew letters
|
||||
if ( word.substr( 0, 1 ) < 'א' || word.substr( 0, 1 ) > 'ת' ) {
|
||||
word = '־' + word;
|
||||
}
|
||||
}
|
||||
|
||||
return word;
|
||||
}
|
||||
} );
|
||||
}( jQuery ) );
|
||||
21
lib/jquery.i18n/languages/hsb.js
Normal file
21
lib/jquery.i18n/languages/hsb.js
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Upper Sorbian (Hornjoserbsce) language functions
|
||||
*/
|
||||
( function ( $ ) {
|
||||
'use strict';
|
||||
|
||||
$.i18n.languages.hsb = $.extend( {}, $.i18n.languages['default'], {
|
||||
convertGrammar: function ( word, form ) {
|
||||
switch ( form ) {
|
||||
case 'instrumental': // instrumental
|
||||
word = 'z ' + word;
|
||||
break;
|
||||
case 'lokatiw': // lokatiw
|
||||
word = 'wo ' + word;
|
||||
break;
|
||||
}
|
||||
|
||||
return word;
|
||||
}
|
||||
} );
|
||||
}( jQuery ) );
|
||||
26
lib/jquery.i18n/languages/hu.js
Normal file
26
lib/jquery.i18n/languages/hu.js
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Hungarian language functions
|
||||
*
|
||||
* @author Santhosh Thottingal
|
||||
*/
|
||||
( function ( $ ) {
|
||||
'use strict';
|
||||
|
||||
$.i18n.languages.hu = $.extend( {}, $.i18n.languages['default'], {
|
||||
convertGrammar: function ( word, form ) {
|
||||
switch ( form ) {
|
||||
case 'rol':
|
||||
word += 'ról';
|
||||
break;
|
||||
case 'ba':
|
||||
word += 'ba';
|
||||
break;
|
||||
case 'k':
|
||||
word += 'k';
|
||||
break;
|
||||
}
|
||||
|
||||
return word;
|
||||
}
|
||||
} );
|
||||
}( jQuery ) );
|
||||
25
lib/jquery.i18n/languages/hy.js
Normal file
25
lib/jquery.i18n/languages/hy.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Armenian (Հայերեն) language functions
|
||||
*/
|
||||
|
||||
( function ( $ ) {
|
||||
'use strict';
|
||||
|
||||
$.i18n.languages.hy = $.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( -1 ) === 'ո' ) {
|
||||
word = word.substr( 0, word.length - 1 ) + 'ոյի';
|
||||
} else if ( word.substr( -4 ) === 'գիրք' ) {
|
||||
word = word.substr( 0, word.length - 4 ) + 'գրքի';
|
||||
} else {
|
||||
word = word + 'ի';
|
||||
}
|
||||
}
|
||||
|
||||
return word;
|
||||
}
|
||||
} );
|
||||
}( jQuery ) );
|
||||
54
lib/jquery.i18n/languages/la.js
Normal file
54
lib/jquery.i18n/languages/la.js
Normal file
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* Latin (lingua Latina) language functions
|
||||
*
|
||||
* @author Santhosh Thottingal
|
||||
*/
|
||||
|
||||
( function ( $ ) {
|
||||
'use strict';
|
||||
|
||||
$.i18n.languages.la = $.extend( {}, $.i18n.languages['default'], {
|
||||
convertGrammar: function ( word, form ) {
|
||||
switch ( form ) {
|
||||
case 'genitive':
|
||||
// only a few declensions, and even for those mostly the singular only
|
||||
word = word.replace( /u[ms]$/i, 'i' ); // 2nd declension singular
|
||||
word = word.replace( /ommunia$/i, 'ommunium' ); // 3rd declension neuter plural (partly)
|
||||
word = word.replace( /a$/i, 'ae' ); // 1st declension singular
|
||||
word = word.replace( /libri$/i, 'librorum' ); // 2nd declension plural (partly)
|
||||
word = word.replace( /nuntii$/i, 'nuntiorum' ); // 2nd declension plural (partly)
|
||||
word = word.replace( /tio$/i, 'tionis' ); // 3rd declension singular (partly)
|
||||
word = word.replace( /ns$/i, 'ntis' );
|
||||
word = word.replace( /as$/i, 'atis' );
|
||||
word = word.replace( /es$/i, 'ei' ); // 5th declension singular
|
||||
break;
|
||||
case 'accusative':
|
||||
// only a few declensions, and even for those mostly the singular only
|
||||
word = word.replace( /u[ms]$/i, 'um' ); // 2nd declension singular
|
||||
word = word.replace( /ommunia$/i, 'am' ); // 3rd declension neuter plural (partly)
|
||||
word = word.replace( /a$/i, 'ommunia' ); // 1st declension singular
|
||||
word = word.replace( /libri$/i, 'libros' ); // 2nd declension plural (partly)
|
||||
word = word.replace( /nuntii$/i, 'nuntios' );// 2nd declension plural (partly)
|
||||
word = word.replace( /tio$/i, 'tionem' ); // 3rd declension singular (partly)
|
||||
word = word.replace( /ns$/i, 'ntem' );
|
||||
word = word.replace( /as$/i, 'atem' );
|
||||
word = word.replace( /es$/i, 'em' ); // 5th declension singular
|
||||
break;
|
||||
case 'ablative':
|
||||
// only a few declensions, and even for those mostly the singular only
|
||||
word = word.replace( /u[ms]$/i, 'o' ); // 2nd declension singular
|
||||
word = word.replace( /ommunia$/i, 'ommunibus' ); // 3rd declension neuter plural (partly)
|
||||
word = word.replace( /a$/i, 'a' ); // 1st declension singular
|
||||
word = word.replace( /libri$/i, 'libris' ); // 2nd declension plural (partly)
|
||||
word = word.replace( /nuntii$/i, 'nuntiis' ); // 2nd declension plural (partly)
|
||||
word = word.replace( /tio$/i, 'tione' ); // 3rd declension singular (partly)
|
||||
word = word.replace( /ns$/i, 'nte' );
|
||||
word = word.replace( /as$/i, 'ate' );
|
||||
word = word.replace( /es$/i, 'e' ); // 5th declension singular
|
||||
break;
|
||||
}
|
||||
|
||||
return word;
|
||||
}
|
||||
} );
|
||||
}( jQuery ) );
|
||||
93
lib/jquery.i18n/languages/ml.js
Normal file
93
lib/jquery.i18n/languages/ml.js
Normal file
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
* Malayalam language functions
|
||||
*
|
||||
* @author Santhosh Thottingal
|
||||
*/
|
||||
|
||||
( function ( $ ) {
|
||||
'use strict';
|
||||
|
||||
$.i18n.languages.ml = $.extend( {}, $.i18n.languages['default'], {
|
||||
convertGrammar: function ( word, form ) {
|
||||
form = form.toLowerCase();
|
||||
switch ( form ) {
|
||||
case 'ഉദ്ദേശിക':
|
||||
case 'dative':
|
||||
if ( word.substr( -1 ) === 'ു'
|
||||
|| word.substr( -1 ) === 'ൂ'
|
||||
|| word.substr( -1 ) === 'ൗ'
|
||||
|| word.substr( -1 ) === 'ൌ' ) {
|
||||
word += 'വിന്';
|
||||
} else if ( word.substr( -1 ) === 'ം' ) {
|
||||
word = word.substr( 0, word.length - 1 ) + 'ത്തിന്';
|
||||
} else if ( word.substr( -1 ) === 'ൻ' ) {
|
||||
// Atomic chillu n. അവൻ -> അവന്
|
||||
word = word.substr( 0, word.length - 1 ) + 'ന്';
|
||||
} else if ( word.substr( -3 ) === 'ന്' ) {
|
||||
// chillu n. അവൻ -> അവന്
|
||||
word = word.substr( 0, word.length - 1 );
|
||||
} else if ( word.substr( -1 ) === 'ൾ' || word.substr( -3 ) === 'ള്' ) {
|
||||
word += 'ക്ക്';
|
||||
} else if ( word.substr( -1 ) === 'ർ' || word.substr( -3 ) === 'ര്' ) {
|
||||
word += 'ക്ക്';
|
||||
} else if ( word.substr( -1 ) === 'ൽ' ) {
|
||||
// Atomic chillu ൽ , ഫയൽ -> ഫയലിന്
|
||||
word = word.substr( 0, word.length - 1 ) + 'ലിന്';
|
||||
} else if ( word.substr( -3 ) === 'ല്' ) {
|
||||
// chillu ല് , ഫയല് -> ഫയലിന്
|
||||
word = word.substr( 0, word.length - 2 ) + 'ിന്';
|
||||
} else if ( word.substr( -2 ) === 'ു്' ) {
|
||||
word = word.substr( 0, word.length - 2 ) + 'ിന്';
|
||||
} else if ( word.substr( -1 ) === '്' ) {
|
||||
word = word.substr( 0, word.length - 1 ) + 'ിന്';
|
||||
} else {
|
||||
// കാവ്യ -> കാവ്യയ്ക്ക്, ഹരി -> ഹരിയ്ക്ക്, മല -> മലയ്ക്ക്
|
||||
word += 'യ്ക്ക്';
|
||||
}
|
||||
break;
|
||||
case 'സംബന്ധിക':
|
||||
case '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( -1 ) === '്' ) {
|
||||
word = word.substr( 0, word.length - 1 ) + 'ിന്റെ';
|
||||
} else if ( word.substr( -1 ) === 'ു'
|
||||
|| word.substr( -1 ) === 'ൂ'
|
||||
|| word.substr( -1 ) === 'ൗ'
|
||||
|| word.substr( -1 ) === 'ൌ' ) {
|
||||
word += 'വിന്റെ';
|
||||
} else if ( word.substr( -1 ) === 'ൻ' ) {
|
||||
// Atomic chillu n. അവൻ -> അവന്റെ
|
||||
word = word.substr( 0, word.length - 1 ) + 'ന്റെ';
|
||||
} else if ( word.substr( -3 ) === 'ന്' ) {
|
||||
// chillu n. അവൻ -> അവന്റെ
|
||||
word = word.substr( 0, word.length -1 ) + 'റെ';
|
||||
} else if ( word.substr( -3 ) === 'ള്' ) {
|
||||
// chillu n. അവൾ -> അവളുടെ
|
||||
word = word.substr( 0, word.length - 2 ) + 'ുടെ';
|
||||
} else if ( word.substr( -1 ) === 'ൾ' ) {
|
||||
// Atomic chillu n. അവള് -> അവളുടെ
|
||||
word = word.substr( 0, word.length - 1 ) + 'ളുടെ';
|
||||
} else if ( word.substr( -1 ) === 'ൽ' ) {
|
||||
// Atomic l. മുയല് -> മുയലിന്റെ
|
||||
word = word.substr( 0, word.length - 1 ) + 'ലിന്റെ';
|
||||
} else if ( word.substr( -3 ) === 'ല്' ) {
|
||||
// chillu l. മുയല് -> അവളുടെ
|
||||
word = word.substr( 0, word.length - 2 ) + 'ിന്റെ';
|
||||
} else if ( word.substr( -3 ) === 'ര്' ) {
|
||||
// chillu r. അവര് -> അവരുടെ
|
||||
word = word.substr( 0, word.length - 2 ) + 'ുടെ';
|
||||
} else if ( word.substr( -1 ) === 'ർ' ) {
|
||||
// Atomic chillu r. അവർ -> അവരുടെ
|
||||
word = word.substr( 0, word.length - 1 ) + 'രുടെ';
|
||||
} else {
|
||||
word += 'യുടെ';
|
||||
}
|
||||
break;
|
||||
}
|
||||
return word;
|
||||
}
|
||||
} );
|
||||
}( jQuery ) );
|
||||
75
lib/jquery.i18n/languages/os.js
Normal file
75
lib/jquery.i18n/languages/os.js
Normal file
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* Ossetian (Ирон) language functions
|
||||
*
|
||||
* @author Santhosh Thottingal
|
||||
*/
|
||||
|
||||
( function ( $ ) {
|
||||
'use strict';
|
||||
|
||||
$.i18n.languages.os = $.extend( {}, $.i18n.languages['default'], {
|
||||
convertGrammar: function ( word, form ) {
|
||||
// Ending for allative case
|
||||
var endAllative = 'мæ';
|
||||
// Variable for 'j' beetwen vowels
|
||||
var jot = '';
|
||||
// Variable for "-" for not Ossetic words
|
||||
var hyphen = '';
|
||||
// Variable for ending
|
||||
var ending = '';
|
||||
// Checking if the $word is in plural form
|
||||
if ( word.match( /тæ$/i ) ) {
|
||||
word = word.substring( 0, word.length - 1 );
|
||||
endAllative = 'æм';
|
||||
}
|
||||
// Works if word is in singular form.
|
||||
// Checking if word ends on one of the vowels: е, ё, и, о, ы, э, ю,
|
||||
// я.
|
||||
else if ( word.match( /[аæеёиоыэюя]$/i ) ) {
|
||||
jot = 'й';
|
||||
}
|
||||
// Checking if word ends on 'у'. 'У' can be either consonant 'W' or
|
||||
// vowel 'U' in cyrillic Ossetic.
|
||||
// Examples: {{grammar:genitive|аунеу}} = аунеуы,
|
||||
// {{grammar:genitive|лæппу}} = лæппуйы.
|
||||
else if ( word.match( /у$/i ) ) {
|
||||
if ( !word.substring( word.length - 2, word.length - 1 )
|
||||
.match( /[аæеёиоыэюя]$/i ) ) {
|
||||
jot = 'й';
|
||||
}
|
||||
} else if ( !word.match( /[бвгджзйклмнопрстфхцчшщьъ]$/i ) ) {
|
||||
hyphen = '-';
|
||||
}
|
||||
|
||||
switch ( form ) {
|
||||
case 'genitive':
|
||||
ending = hyphen + jot + 'ы';
|
||||
break;
|
||||
case 'dative':
|
||||
ending = hyphen + jot + 'æн';
|
||||
break;
|
||||
case 'allative':
|
||||
ending = hyphen + endAllative;
|
||||
break;
|
||||
case 'ablative':
|
||||
if ( jot === 'й' ) {
|
||||
ending = hyphen + jot + 'æ';
|
||||
} else {
|
||||
ending = hyphen + jot + 'æй';
|
||||
}
|
||||
break;
|
||||
case 'superessive':
|
||||
ending = hyphen + jot + 'ыл';
|
||||
break;
|
||||
case 'equative':
|
||||
ending = hyphen + jot + 'ау';
|
||||
break;
|
||||
case 'comitative':
|
||||
ending = hyphen + 'имæ';
|
||||
break;
|
||||
}
|
||||
|
||||
return word + ending;
|
||||
}
|
||||
} );
|
||||
}( jQuery ) );
|
||||
33
lib/jquery.i18n/languages/ru.js
Normal file
33
lib/jquery.i18n/languages/ru.js
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Russian (Русский) language functions
|
||||
*/
|
||||
|
||||
( function ( $ ) {
|
||||
'use strict';
|
||||
|
||||
$.i18n.languages.ru = $.extend( {}, $.i18n.languages['default'], {
|
||||
convertGrammar: function ( word, form ) {
|
||||
if ( form === 'genitive' ) { // родительный падеж
|
||||
if ( ( word.substr( word.length - 4 ) === 'вики' ) ||
|
||||
( word.substr( word.length - 4 ) === 'Вики' )
|
||||
) {
|
||||
// ...
|
||||
} else if ( word.substr( word.length - 1 ) === 'ь' ) {
|
||||
word = word.substr( 0, word.length - 1 ) + 'я';
|
||||
} else if ( word.substr( word.length - 2 ) === 'ия' ) {
|
||||
word = word.substr( 0, word.length - 2 ) + 'ии';
|
||||
} else if ( word.substr( word.length - 2 ) === 'ка' ) {
|
||||
word = word.substr( 0, word.length - 2 ) + 'ки';
|
||||
} else if ( word.substr( word.length - 2 ) === 'ти' ) {
|
||||
word = word.substr( 0, word.length - 2 ) + 'тей';
|
||||
} else if ( word.substr( word.length - 2 ) === 'ды' ) {
|
||||
word = word.substr( 0, word.length - 2 ) + 'дов';
|
||||
} else if ( word.substr( word.length - 3 ) === 'ник' ) {
|
||||
word = word.substr( 0, word.length - 3 ) + 'ника';
|
||||
}
|
||||
}
|
||||
|
||||
return word;
|
||||
}
|
||||
} );
|
||||
}( jQuery ) );
|
||||
26
lib/jquery.i18n/languages/sl.js
Normal file
26
lib/jquery.i18n/languages/sl.js
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Slovenian (Slovenščina) language functions
|
||||
*/
|
||||
|
||||
( function ( $ ) {
|
||||
'use strict';
|
||||
|
||||
$.i18n.languages.sl = $.extend( {}, $.i18n.languages['default'], {
|
||||
convertGrammar: function ( word, form ) {
|
||||
switch ( form ) {
|
||||
// locative
|
||||
case 'mestnik':
|
||||
word = 'o ' + word;
|
||||
|
||||
break;
|
||||
// instrumental
|
||||
case 'orodnik':
|
||||
word = 'z ' + word;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return word;
|
||||
}
|
||||
} );
|
||||
}( jQuery ) );
|
||||
47
lib/jquery.i18n/languages/uk.js
Normal file
47
lib/jquery.i18n/languages/uk.js
Normal file
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* Ukrainian (Українська) language functions
|
||||
*/
|
||||
|
||||
( function ( $ ) {
|
||||
'use strict';
|
||||
|
||||
$.i18n.languages.uk = $.extend( {}, $.i18n.languages['default'], {
|
||||
convertGrammar: function ( word, form ) {
|
||||
switch ( form ) {
|
||||
case 'genitive': // родовий відмінок
|
||||
if ( ( word.substr( word.length - 4 ) === 'вікі' ) ||
|
||||
( word.substr( word.length - 4 ) === 'Вікі' )
|
||||
) {
|
||||
// ...
|
||||
} else if ( word.substr( word.length - 1 ) === 'ь' ) {
|
||||
word = word.substr( 0, word.length - 1 ) + 'я';
|
||||
} else if ( word.substr( word.length - 2 ) === 'ія' ) {
|
||||
word = word.substr( 0, word.length - 2 ) + 'ії';
|
||||
} else if ( word.substr( word.length - 2 ) === 'ка' ) {
|
||||
word = word.substr( 0, word.length - 2 ) + 'ки';
|
||||
} else if ( word.substr( word.length - 2 ) === 'ти' ) {
|
||||
word = word.substr( 0, word.length - 2 ) + 'тей';
|
||||
} else if ( word.substr( word.length - 2 ) === 'ды' ) {
|
||||
word = word.substr( 0, word.length - 2 ) + 'дов';
|
||||
} else if ( word.substr( word.length - 3 ) === 'ник' ) {
|
||||
word = word.substr( 0, word.length - 3 ) + 'ника';
|
||||
}
|
||||
|
||||
break;
|
||||
case 'accusative': // знахідний відмінок
|
||||
if ( ( word.substr( word.length - 4 ) === 'вікі' ) ||
|
||||
( word.substr( word.length - 4 ) === 'Вікі' )
|
||||
) {
|
||||
// ...
|
||||
} else if ( word.substr( word.length - 2 ) === 'ія' ) {
|
||||
word = word.substr( 0, word.length - 2 ) + 'ію';
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return word;
|
||||
}
|
||||
} );
|
||||
|
||||
}( jQuery ) );
|
||||
Reference in New Issue
Block a user