Index: branches/jsgrammar/tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js |
— | — | @@ -46,9 +46,10 @@ |
47 | 47 | expect( 5 ); |
48 | 48 | var parser = mw.jqueryMsg.getMessageFunction(); |
49 | 49 | ok( parser, 'Parser Function initialized' ); |
50 | | - ok( mw.messages.set( 'grammar-msg', 'Przeszukaj {{GRAMMAR:genitive|{{SITENAME}}}}' ), 'mw.messages.set: Register' ); |
| 50 | + // Hope the grammar form rammar_case_foo is not valid in any language |
| 51 | + ok( mw.messages.set( 'grammar-msg', 'Przeszukaj {{GRAMMAR:grammar_case_foo|{{SITENAME}}}}' ), 'mw.messages.set: Register' ); |
51 | 52 | equal( parser( 'grammar-msg' ) , 'Przeszukaj ' + mw.config.get( 'wgSiteName' ) , 'Grammar Test with sitename' ); |
52 | | - ok( mw.messages.set( 'grammar-msg-wrong-syntax', 'Przeszukaj {{GRAMMAR:genitive}}' ), 'mw.messages.set: Register' ); |
| 53 | + ok( mw.messages.set( 'grammar-msg-wrong-syntax', 'Przeszukaj {{GRAMMAR:grammar_case_xyz}}' ), 'mw.messages.set: Register' ); |
53 | 54 | equal( parser( 'grammar-msg-wrong-syntax' ) , 'Przeszukaj ' , 'Grammar Test with wrong grammar template syntax' ); |
54 | 55 | } ); |
55 | 56 | |
Index: branches/jsgrammar/resources/mediawiki/mediawiki.jqueryMsg.js |
— | — | @@ -672,7 +672,7 @@ |
673 | 673 | grammar: function( nodes ) { |
674 | 674 | var form = nodes[0]; |
675 | 675 | var word = nodes[1]; |
676 | | - return this.language.convertGrammar( word, form ); |
| 676 | + return word && form && this.language.convertGrammar( word, form ); |
677 | 677 | } |
678 | 678 | }; |
679 | 679 | |
Index: branches/jsgrammar/resources/mediawiki.language/languages/fi.js |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | |
13 | 13 | // vowel harmony flag |
14 | 14 | var aou = word.match( /[aou][^äöy]*$/i ); |
15 | | - |
| 15 | + var origWord = word; |
16 | 16 | if ( word.match( /wiki$/i ) ) { |
17 | 17 | aou = false; |
18 | 18 | } |
— | — | @@ -36,6 +36,9 @@ |
37 | 37 | case 'inessive': |
38 | 38 | word += ( aou ? 'ssa' : 'ssä' ); |
39 | 39 | break; |
| 40 | + default: |
| 41 | + word = origWord; |
| 42 | + break; |
40 | 43 | } |
41 | 44 | return word; |
42 | 45 | }; |