Merge "Add tests for WikiMap and WikiReference"
[lhc/web/wiklou.git] / resources / src / mediawiki.language / languages / os.js
index 787be36..3e0f279 100644 (file)
@@ -14,22 +14,21 @@ mediaWiki.language.convertGrammar = function ( word, form ) {
                // Variable for ending
                ending = '';
 
-       if ( grammarForms && grammarForms[form] ) {
-               return grammarForms[form][word];
+       if ( grammarForms && grammarForms[ form ] ) {
+               return grammarForms[ form ][ word ];
        }
        // Checking if the $word is in plural form
        if ( word.match( /тæ$/i ) ) {
                word = word.slice( 0, -1 );
                endAllative = 'æм';
-       }
-       // Works if word is in singular form.
-       // Checking if word ends on one of the vowels: е, ё, и, о, ы, э, ю, я.
-       else if ( word.match( /[аæеёиоыэюя]$/i ) ) {
+       } else if ( word.match( /[аæеёиоыэюя]$/i ) ) {
+               // Works if word is in singular form.
+               // Checking if word ends on one of the vowels: е, ё, и, о, ы, э, ю, я.
                jot = 'й';
-       }
-       // Checking if word ends on 'у'. 'У' can be either consonant 'W' or vowel 'U' in cyrillic Ossetic.
-       // Examples: {{grammar:genitive|аунеу}} = аунеуы, {{grammar:genitive|лæппу}} = лæппуйы.
-       else if ( word.match( /у$/i ) ) {
+       } else if ( word.match( /у$/i ) ) {
+               // Checking if word ends on 'у'. 'У' can be either consonant 'W' or vowel 'U' in cyrillic Ossetic.
+               // Examples: {{grammar:genitive|аунеу}} = аунеуы, {{grammar:genitive|лæппу}} = лæппуйы.
+
                if ( !word.slice( -2, -1 ).match( /[аæеёиоыэюя]$/i ) ) {
                        jot = 'й';
                }
@@ -50,8 +49,7 @@ mediaWiki.language.convertGrammar = function ( word, form ) {
                case 'ablative':
                        if ( jot === 'й' ) {
                                ending = hyphen + jot + 'æ';
-                       }
-                       else {
+                       } else {
                                ending = hyphen + jot + 'æй';
                        }
                        break;