1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mediawiki_ynh.git synced 2024-09-03 19:46:05 +02:00
mediawiki_ynh/sources/mediawiki/resources/mediawiki.language/languages/hy.js

29 lines
943 B
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.

/**
* Armenian (Հայերեն) language functions
*/
mediaWiki.language.convertGrammar = function ( word, form ) {
/*jshint onecase:true */
var grammarForms = mediaWiki.language.getData( 'hy', 'grammarForms' );
if ( grammarForms && grammarForms[form] ) {
return grammarForms[form][word];
}
// These rules are not perfect, but they are currently only used for site names so it doesn't
// matter if they are wrong sometimes. Just add a special case for your site name if necessary.
switch ( form ) {
case '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 + 'ի';
}
break;
}
return word;
};