Index: branches/jsgrammar/tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js |
— | — | @@ -5,7 +5,6 @@ |
6 | 6 | ok( mw.language, 'mw.language defined' ); |
7 | 7 | } ); |
8 | 8 | |
9 | | - |
10 | 9 | mw.language.grammartest = function( options ) { |
11 | 10 | var opt = $.extend({ |
12 | 11 | language: '', |
— | — | @@ -29,7 +28,7 @@ |
30 | 29 | { word: 'word', grammarForm: 'instrumental', expected: 's word', description: 'Grammar test for Bosnian, instrumental case' }, |
31 | 30 | { word: 'word', grammarForm: 'lokativ', expected: 'o word', description: 'Grammar test for Bosnian, lokativ case' } |
32 | 31 | ] |
33 | | -}); |
| 32 | +}); |
34 | 33 | |
35 | 34 | mw.language.grammartest({ |
36 | 35 | language: 'he', |
— | — | @@ -40,7 +39,7 @@ |
41 | 40 | { word: 'Wikipedia', grammarForm: 'תחילית', expected: '־Wikipedia', description: 'Grammar test for Hebrew, Add a hyphen (maqaf) before non-Hebrew letters' } |
42 | 41 | { word: '1995', grammarForm: 'תחילית', expected: '־1995', description: 'Grammar test for Hebrew, Add a hyphen (maqaf) before numbers' } |
43 | 42 | ] |
44 | | -}); |
| 43 | +}); |
45 | 44 | |
46 | 45 | mw.language.grammartest({ |
47 | 46 | language: 'hsb', |
— | — | @@ -48,9 +47,17 @@ |
49 | 48 | { word: 'word', grammarForm: 'instrumental', expected: 'z word', description: 'Grammar test for Upper Sorbian, instrumental case' }, |
50 | 49 | { word: 'word', grammarForm: 'lokatiw', expected: 'wo word', description: 'Grammar test for Upper Sorbian, lokatiw case' } |
51 | 50 | ] |
52 | | -}); |
| 51 | +}); |
53 | 52 | |
54 | 53 | mw.language.grammartest({ |
| 54 | + language: 'dsb', |
| 55 | + test: [ |
| 56 | + { word: 'word', grammarForm: 'instrumental', expected: 'z word', description: 'Grammar test for Lower Sorbian, instrumental case' }, |
| 57 | + { word: 'word', grammarForm: 'lokatiw', expected: 'wo word', description: 'Grammar test for Lower Sorbian, lokatiw case' } |
| 58 | + ] |
| 59 | +}); |
| 60 | + |
| 61 | +mw.language.grammartest({ |
55 | 62 | language: 'hy', |
56 | 63 | test: [ |
57 | 64 | { word: 'Մաունա', grammarForm: 'genitive', expected: 'Մաունայի', description: 'Grammar test for Armenian, genitive case' }, |
— | — | @@ -83,4 +90,22 @@ |
84 | 91 | { word: 'доводы', grammarForm: 'genitive', expected: 'доводов', description: 'Grammar test for Russian, genitive case' }, |
85 | 92 | { word: 'песчаник', grammarForm: 'genitive', expected: 'песчаника', description: 'Grammar test for Russian, genitive case' } |
86 | 93 | ] |
87 | | -}); |
| 94 | +}); |
| 95 | + |
| 96 | +mw.language.grammartest({ |
| 97 | + language: 'hu', |
| 98 | + test: [ |
| 99 | + { word: 'Wikipédiá', grammarForm: 'rol', expected: 'Wikipédiáról', description: 'Grammar test for Hungarian, rol case' }, |
| 100 | + { word: 'Wikipédiá', grammarForm: 'ba', expected: 'Wikipédiába', description: 'Grammar test for Hungarian, ba case' }, |
| 101 | + { word: 'Wikipédiá', grammarForm: 'k', expected: 'Wikipédiák', description: 'Grammar test for Hungarian, k case' }, |
| 102 | + ] |
| 103 | +}); |
| 104 | + |
| 105 | +mw.language.grammartest({ |
| 106 | + language: 'ga', |
| 107 | + test: [ |
| 108 | + { word: 'an Domhnach', grammarForm: 'ainmlae', expected: 'Dé Domhnaigh', description: 'Grammar test for Irish, ainmlae case' }, |
| 109 | + { word: 'an Luan', grammarForm: 'ainmlae', expected: 'Dé Luain', description: 'Grammar test for Irish, ainmlae case' }, |
| 110 | + { word: 'an Satharn', grammarForm: 'ainmlae', expected: 'Dé Sathairn', description: 'Grammar test for Irish, ainmlae case' }, |
| 111 | + ] |
| 112 | +}); |
Index: branches/jsgrammar/resources/Resources.php |
— | — | @@ -679,6 +679,7 @@ |
680 | 680 | 'hi' => 'resources/mediawiki.language/languages/hi.js', |
681 | 681 | 'hr' => 'resources/mediawiki.language/languages/hr.js', |
682 | 682 | 'hsb' => 'resources/mediawiki.language/languages/hsb.js', |
| 683 | + 'hu' => 'resources/mediawiki.language/languages/hu.js', |
683 | 684 | 'hy' => 'resources/mediawiki.language/languages/hy.js', |
684 | 685 | 'ksh' => 'resources/mediawiki.language/languages/ksh.js', |
685 | 686 | 'ln' => 'resources/mediawiki.language/languages/ln.js', |
Index: branches/jsgrammar/resources/mediawiki.language/languages/dsb.js |
— | — | @@ -16,3 +16,19 @@ |
17 | 17 | return forms[3]; |
18 | 18 | } |
19 | 19 | }; |
| 20 | + |
| 21 | +mediaWiki.language.convertGrammar = function( word, form ) { |
| 22 | + var grammarForms = mw.language.data[ 'dsb' ].get( 'grammarForms' ); |
| 23 | + if ( grammarForms && grammarForms[form] ) { |
| 24 | + return grammarForms[form][word] ; |
| 25 | + } |
| 26 | + switch ( form ) { |
| 27 | + case 'instrumental': // instrumental |
| 28 | + word = 'z ' + word; |
| 29 | + break; |
| 30 | + case 'lokatiw': // lokatiw |
| 31 | + word = 'wo ' + word; |
| 32 | + break; |
| 33 | + } |
| 34 | + return word; |
| 35 | +}; |
Index: branches/jsgrammar/resources/mediawiki.language/languages/hu.js |
— | — | @@ -0,0 +1,23 @@ |
| 2 | +/** |
| 3 | + * Hungarian language functions |
| 4 | + * @author Santhosh Thottingal |
| 5 | + */ |
| 6 | + |
| 7 | +mediaWiki.language.convertGrammar = function( word, form ) { |
| 8 | + var grammarForms = mw.language.data[ 'hu' ].get( 'grammarForms' ); |
| 9 | + if ( grammarForms && grammarForms[form] ) { |
| 10 | + return grammarForms[form][word] ; |
| 11 | + } |
| 12 | + switch ( form ) { |
| 13 | + case 'rol': |
| 14 | + word += 'ról'; |
| 15 | + break; |
| 16 | + case 'ba': |
| 17 | + word += 'ba'; |
| 18 | + break; |
| 19 | + case 'k': |
| 20 | + word += 'k'; |
| 21 | + break; |
| 22 | + } |
| 23 | + return word; |
| 24 | +}; |
Property changes on: branches/jsgrammar/resources/mediawiki.language/languages/hu.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 25 | + native |
Index: branches/jsgrammar/resources/mediawiki.language/languages/ga.js |
— | — | @@ -12,3 +12,38 @@ |
13 | 13 | } |
14 | 14 | return forms[2]; |
15 | 15 | }; |
| 16 | + |
| 17 | + |
| 18 | +mediaWiki.language.convertGrammar = function( word, form ) { |
| 19 | + var grammarForms = mw.language.data[ 'ga' ].get( 'grammarForms' ); |
| 20 | + if ( grammarForms && grammarForms[form] ) { |
| 21 | + return grammarForms[form][word] ; |
| 22 | + } |
| 23 | + switch ( form ) { |
| 24 | + case 'ainmlae': |
| 25 | + switch ( word ) { |
| 26 | + case 'an Domhnach': |
| 27 | + word = 'Dé Domhnaigh'; |
| 28 | + break; |
| 29 | + case 'an Luan': |
| 30 | + word = 'Dé Luain'; |
| 31 | + break; |
| 32 | + case 'an Mháirt': |
| 33 | + word = 'Dé Mháirt'; |
| 34 | + break; |
| 35 | + case 'an Chéadaoin': |
| 36 | + word = 'Dé Chéadaoin'; |
| 37 | + break; |
| 38 | + case 'an Déardaoin': |
| 39 | + word = 'Déardaoin'; |
| 40 | + break; |
| 41 | + case 'an Aoine': |
| 42 | + word = 'Dé hAoine'; |
| 43 | + break; |
| 44 | + case 'an Satharn': |
| 45 | + word = 'Dé Sathairn'; |
| 46 | + break; |
| 47 | + } |
| 48 | + } |
| 49 | + return word; |
| 50 | +}; |
Index: branches/jsgrammar/resources/mediawiki.language/languages/fi.js |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | } |
12 | 12 | |
13 | 13 | // vowel harmony flag |
14 | | - aou = word.match( /[aou][^äöy]*$/i ); |
| 14 | + var aou = word.match( /[aou][^äöy]*$/i ); |
15 | 15 | |
16 | 16 | if ( word.match( /wiki$/i ) ) { |
17 | 17 | aou = false; |