2 * Armenian (Հայերեն) language functions
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
] ;
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.
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 ) + 'գրքի';