Remove all custom plural rules and use CLDR plural rule system
[lhc/web/wiklou.git] / resources / mediawiki.language / languages / hy.js
1 /**
2 * Armenian (Հայերեն) language functions
3 */
4
5 mediaWiki.language.convertGrammar = function( word, form ) {
6 var grammarForms = mw.language.getData( 'hy', 'grammarForms' );
7 if ( grammarForms && grammarForms[form] ) {
8 return grammarForms[form][word] ;
9 }
10
11 // These rules are not perfect, but they are currently only used for site names so it doesn't
12 // matter if they are wrong sometimes. Just add a special case for your site name if necessary.
13
14 switch ( form ) {
15 case 'genitive': // սեռական հոլով
16 if ( word.substr( -1 ) === 'ա' )
17 word = word.substr( 0, word.length -1 ) + 'այի';
18 else if ( word.substr( -1 ) === 'ո' )
19 word = word.substr( 0, word.length - 1 ) + 'ոյի';
20 else if ( word.substr( -4 ) === 'գիրք' )
21 word = word.substr( 0, word.length - 4 ) + 'գրքի';
22 else
23 word = word + 'ի';
24 break;
25 }
26 return word;
27 };