diff options
Diffstat (limited to 'resources/lib/jquery.i18n/src/languages')
-rw-r--r-- | resources/lib/jquery.i18n/src/languages/bs.js | 22 | ||||
-rw-r--r-- | resources/lib/jquery.i18n/src/languages/dsb.js | 22 | ||||
-rw-r--r-- | resources/lib/jquery.i18n/src/languages/fi.js | 49 | ||||
-rw-r--r-- | resources/lib/jquery.i18n/src/languages/ga.js | 38 | ||||
-rw-r--r-- | resources/lib/jquery.i18n/src/languages/he.js | 31 | ||||
-rw-r--r-- | resources/lib/jquery.i18n/src/languages/hsb.js | 21 | ||||
-rw-r--r-- | resources/lib/jquery.i18n/src/languages/hu.js | 26 | ||||
-rw-r--r-- | resources/lib/jquery.i18n/src/languages/hy.js | 25 | ||||
-rw-r--r-- | resources/lib/jquery.i18n/src/languages/la.js | 54 | ||||
-rw-r--r-- | resources/lib/jquery.i18n/src/languages/ml.js | 98 | ||||
-rw-r--r-- | resources/lib/jquery.i18n/src/languages/os.js | 76 | ||||
-rw-r--r-- | resources/lib/jquery.i18n/src/languages/ru.js | 29 | ||||
-rw-r--r-- | resources/lib/jquery.i18n/src/languages/sl.js | 26 | ||||
-rw-r--r-- | resources/lib/jquery.i18n/src/languages/uk.js | 39 |
14 files changed, 556 insertions, 0 deletions
diff --git a/resources/lib/jquery.i18n/src/languages/bs.js b/resources/lib/jquery.i18n/src/languages/bs.js new file mode 100644 index 00000000..5370069e --- /dev/null +++ b/resources/lib/jquery.i18n/src/languages/bs.js @@ -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 ) ); diff --git a/resources/lib/jquery.i18n/src/languages/dsb.js b/resources/lib/jquery.i18n/src/languages/dsb.js new file mode 100644 index 00000000..cc069ebf --- /dev/null +++ b/resources/lib/jquery.i18n/src/languages/dsb.js @@ -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 ) ); diff --git a/resources/lib/jquery.i18n/src/languages/fi.js b/resources/lib/jquery.i18n/src/languages/fi.js new file mode 100644 index 00000000..d8e9578a --- /dev/null +++ b/resources/lib/jquery.i18n/src/languages/fi.js @@ -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 ) ); diff --git a/resources/lib/jquery.i18n/src/languages/ga.js b/resources/lib/jquery.i18n/src/languages/ga.js new file mode 100644 index 00000000..1aceab75 --- /dev/null +++ b/resources/lib/jquery.i18n/src/languages/ga.js @@ -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 ) ); diff --git a/resources/lib/jquery.i18n/src/languages/he.js b/resources/lib/jquery.i18n/src/languages/he.js new file mode 100644 index 00000000..cbbe90b9 --- /dev/null +++ b/resources/lib/jquery.i18n/src/languages/he.js @@ -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 ) ); diff --git a/resources/lib/jquery.i18n/src/languages/hsb.js b/resources/lib/jquery.i18n/src/languages/hsb.js new file mode 100644 index 00000000..957616f6 --- /dev/null +++ b/resources/lib/jquery.i18n/src/languages/hsb.js @@ -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 ) ); diff --git a/resources/lib/jquery.i18n/src/languages/hu.js b/resources/lib/jquery.i18n/src/languages/hu.js new file mode 100644 index 00000000..1177b850 --- /dev/null +++ b/resources/lib/jquery.i18n/src/languages/hu.js @@ -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 ) ); diff --git a/resources/lib/jquery.i18n/src/languages/hy.js b/resources/lib/jquery.i18n/src/languages/hy.js new file mode 100644 index 00000000..9c568992 --- /dev/null +++ b/resources/lib/jquery.i18n/src/languages/hy.js @@ -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 ) ); diff --git a/resources/lib/jquery.i18n/src/languages/la.js b/resources/lib/jquery.i18n/src/languages/la.js new file mode 100644 index 00000000..11c1122d --- /dev/null +++ b/resources/lib/jquery.i18n/src/languages/la.js @@ -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 ) ); diff --git a/resources/lib/jquery.i18n/src/languages/ml.js b/resources/lib/jquery.i18n/src/languages/ml.js new file mode 100644 index 00000000..f724b7b2 --- /dev/null +++ b/resources/lib/jquery.i18n/src/languages/ml.js @@ -0,0 +1,98 @@ +/** + * 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 ) === 'ന്\u200d' ) { + // chillu n. അവൻ -> അവന് + word = word.substr( 0, word.length - 1 ); + } else if ( word.substr( -1 ) === 'ൾ' || word.substr( -3 ) === 'ള്\u200d' ) { + word += 'ക്ക്'; + } else if ( word.substr( -1 ) === 'ർ' || word.substr( -3 ) === 'ര്\u200d' ) { + word += 'ക്ക്'; + } else if ( word.substr( -1 ) === 'ൽ' ) { + // Atomic chillu ൽ , ഫയൽ -> ഫയലിന് + word = word.substr( 0, word.length - 1 ) + 'ലിന്'; + } else if ( word.substr( -3 ) === 'ല്\u200d' ) { + // chillu ല്\u200d , ഫയല്\u200d -> ഫയലിന് + 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 ) === 'ന്\u200d' ) { + // chillu n. അവൻ -> അവന്റെ + word = word.substr( 0, word.length - 1 ) + 'റെ'; + } else if ( word.substr( -3 ) === 'ള്\u200d' ) { + // chillu n. അവൾ -> അവളുടെ + word = word.substr( 0, word.length - 2 ) + 'ുടെ'; + } else if ( word.substr( -1 ) === 'ൾ' ) { + // Atomic chillu n. അവള്\u200d -> അവളുടെ + word = word.substr( 0, word.length - 1 ) + 'ളുടെ'; + } else if ( word.substr( -1 ) === 'ൽ' ) { + // Atomic l. മുയല്\u200d -> മുയലിന്റെ + word = word.substr( 0, word.length - 1 ) + 'ലിന്റെ'; + } else if ( word.substr( -3 ) === 'ല്\u200d' ) { + // chillu l. മുയല്\u200d -> അവളുടെ + word = word.substr( 0, word.length - 2 ) + 'ിന്റെ'; + } else if ( word.substr( -3 ) === 'ര്\u200d' ) { + // chillu r. അവര്\u200d -> അവരുടെ + 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 ) ); diff --git a/resources/lib/jquery.i18n/src/languages/os.js b/resources/lib/jquery.i18n/src/languages/os.js new file mode 100644 index 00000000..47443671 --- /dev/null +++ b/resources/lib/jquery.i18n/src/languages/os.js @@ -0,0 +1,76 @@ +/** + * Ossetian (Ирон) language functions + * + * @author Santhosh Thottingal + */ + +( function ( $ ) { + 'use strict'; + + $.i18n.languages.os = $.extend( {}, $.i18n.languages['default'], { + convertGrammar: function ( word, form ) { + var endAllative, jot, hyphen, ending; + + // Ending for allative case + endAllative = 'мæ'; + // Variable for 'j' beetwen vowels + jot = ''; + // Variable for "-" for not Ossetic words + hyphen = ''; + // Variable for ending + ending = ''; + + if ( word.match( /тæ$/i ) ) { + // Checking if the $word is in plural form + word = word.substring( 0, word.length - 1 ); + endAllative = 'æм'; + } else if ( word.match( /[аæеёиоыэюя]$/i ) ) { + // Works if word is in singular form. + // Checking if word ends on one of the vowels: е, ё, и, о, ы, э, ю, + // я. + jot = 'й'; + } else if ( word.match( /у$/i ) ) { + // Checking if word ends on 'у'. 'У' can be either consonant 'W' or + // vowel 'U' in cyrillic Ossetic. + // Examples: {{grammar:genitive|аунеу}} = аунеуы, + // {{grammar:genitive|лæппу}} = лæппуйы. + 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 ) ); diff --git a/resources/lib/jquery.i18n/src/languages/ru.js b/resources/lib/jquery.i18n/src/languages/ru.js new file mode 100644 index 00000000..893b2386 --- /dev/null +++ b/resources/lib/jquery.i18n/src/languages/ru.js @@ -0,0 +1,29 @@ +/** + * Russian (Русский) language functions + */ + +( function ( $ ) { + 'use strict'; + + $.i18n.languages.ru = $.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( -2 ) === 'ия' ) { + word = word.substr( 0, word.length - 2 ) + 'ии'; + } else if ( word.substr( -2 ) === 'ка' ) { + word = word.substr( 0, word.length - 2 ) + 'ки'; + } else if ( word.substr( -2 ) === 'ти' ) { + word = word.substr( 0, word.length - 2 ) + 'тей'; + } else if ( word.substr( -2 ) === 'ды' ) { + word = word.substr( 0, word.length - 2 ) + 'дов'; + } else if ( word.substr( -3 ) === 'ник' ) { + word = word.substr( 0, word.length - 3 ) + 'ника'; + } + } + + return word; + } + } ); +}( jQuery ) ); diff --git a/resources/lib/jquery.i18n/src/languages/sl.js b/resources/lib/jquery.i18n/src/languages/sl.js new file mode 100644 index 00000000..a3aafc3b --- /dev/null +++ b/resources/lib/jquery.i18n/src/languages/sl.js @@ -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 ) ); diff --git a/resources/lib/jquery.i18n/src/languages/uk.js b/resources/lib/jquery.i18n/src/languages/uk.js new file mode 100644 index 00000000..8e69efcd --- /dev/null +++ b/resources/lib/jquery.i18n/src/languages/uk.js @@ -0,0 +1,39 @@ +/** + * Ukrainian (Українська) language functions + */ + +( function ( $ ) { + 'use strict'; + + $.i18n.languages.uk = $.extend( {}, $.i18n.languages['default'], { + convertGrammar: function ( word, form ) { + switch ( form ) { + 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( -2 ) === 'ка' ) { + word = word.substr( 0, word.length - 2 ) + 'ки'; + } else if ( word.substr( -2 ) === 'ти' ) { + word = word.substr( 0, word.length - 2 ) + 'тей'; + } else if ( word.substr( -2 ) === 'ды' ) { + word = word.substr( 0, word.length - 2 ) + 'дов'; + } else if ( word.substr( -3 ) === 'ник' ) { + word = word.substr( 0, word.length - 3 ) + 'ника'; + } + + break; + case 'accusative': // знахідний відмінок + if ( word.substr( -2 ) === 'ія' ) { + word = word.substr( 0, word.length - 2 ) + 'ію'; + } + + break; + } + + return word; + } + } ); + +}( jQuery ) ); |