Show an autonym for languages that don't have input methods

Bug: 51025
Change-Id: I4a6cc9a79f186941cc79533de90ab0fb7e104673
This commit is contained in:
Amir E. Aharoni
2013-08-20 17:08:36 +03:00
parent 60e038b0db
commit a1ad38d715

View File

@@ -181,9 +181,18 @@
$.extend( $.ime.defaults, {
imePath: mwImeRulesPath
} );
// Load the ime preferences
$.ime.preferences.load();
$.fn.imeselector.Constructor.prototype.helpLink = customHelpLink;
// Override the autonym function for the case that
// somebody tries to select a language for which there are
// no input methods, which is possible in MediaWiki
$.fn.imeselector.Constructor.prototype.getAutonym = function ( languageCode ) {
return $.uls.data.getAutonym( languageCode );
};
};
mw.ime.setup = function () {
@@ -260,7 +269,7 @@
// Some fields may be uninitialized
imeselector = $input.data( 'imeselector' );
if ( imeselector ) {
imeselector.selectLanguage( $.ime.preferences.getLanguage() );
imeselector.selectLanguage( imeselector.decideLanguage() );
imeselector.$element.on( 'setim.ime', function ( event, inputMethod ) {
mw.hook( 'mw.uls.ime.change' ).fire( inputMethod );
} );