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