Index: trunk/extensions/EducationProgram/resources/ep.api.js |
— | — | @@ -6,6 +6,22 @@ |
7 | 7 | * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
8 | 8 | */ |
9 | 9 | |
| 10 | +if ( typeof mw.language.gender === 'undefined' ) { |
| 11 | + mw.language.gender = function( gender, forms ) { |
| 12 | + if ( !forms || forms.length === 0 ) { |
| 13 | + return ''; |
| 14 | + } |
| 15 | + forms = mw.language.preConvertPlural( forms, 2 ); |
| 16 | + if ( gender === 'male' ) { |
| 17 | + return forms[0]; |
| 18 | + } |
| 19 | + if ( gender === 'female' ) { |
| 20 | + return forms[1]; |
| 21 | + } |
| 22 | + return ( forms.length === 3 ) ? forms[2] : forms[0]; |
| 23 | + }; |
| 24 | +} |
| 25 | + |
10 | 26 | window.educationProgram = new( function() { |
11 | 27 | |
12 | 28 | // TODO: move to own file |