Files
mediawiki-extensions-Univer…/lib/jquery.i18n/languages/ml.js
Santhosh Thottingal 28154206bf 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
2013-07-15 13:28:12 +00:00

94 lines
4.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 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 ) );