Index: trunk/extensions/UploadWizard/resources/mw.LanguageUpWiz.js |
— | — | @@ -17,6 +17,7 @@ |
18 | 18 | |
19 | 19 | /** |
20 | 20 | * List of default languages |
| 21 | + * Make sure you have language templates set up for each of these on your wiki, e.g. {{en}} |
21 | 22 | */ |
22 | 23 | languages: [ |
23 | 24 | { lang: "de", text: "Deutsch" }, |
— | — | @@ -41,17 +42,20 @@ |
42 | 43 | if ( mw.LanguageUpWiz.initialized ) { |
43 | 44 | return; |
44 | 45 | } |
| 46 | + // if a language list is defined locally (MediaWiki:LanguageHandler.js), use that list instead |
45 | 47 | if ( typeof LanguageHandler != 'undefined' ) { |
46 | 48 | this.languages = LanguageHandler.languages; |
47 | 49 | } |
48 | 50 | mw.LanguageUpWiz._codes = {}; |
49 | 51 | var select = $j( '<select/>' ); |
50 | 52 | $j.each( mw.LanguageUpWiz.languages, function( i, language ) { |
| 53 | + // add an option for each language |
51 | 54 | select.append( |
52 | 55 | $j( '<option>' ) |
53 | 56 | .attr( 'value', language.lang ) |
54 | 57 | .append( language.text ) |
55 | 58 | ); |
| 59 | + // add each language into dictionary |
56 | 60 | mw.LanguageUpWiz._codes[language.lang] = language.text; |
57 | 61 | } ); |
58 | 62 | mw.LanguageUpWiz.$_select = select; |