jquery.i18n message store for ULS

Bug: 49935
Change-Id: Iddef0805abbf9b4ff0e606fc311c57e9dfa7107d
This commit is contained in:
Santhosh Thottingal
2013-07-04 20:16:27 +05:30
committed by Santhosh
parent 8ddff0b2fc
commit 3d6e4a007f
2 changed files with 80 additions and 20 deletions

View File

@@ -204,8 +204,7 @@
// set the language for the settings panel so that webfonts
// are correctly applied.
displaySettings.$template.attr( 'lang', displaySettings.uiLanguage );
$.i18n().locale = displaySettings.uiLanguage;
displaySettings.i18n();
displaySettings.preview( displaySettings.uiLanguage );
};
}
@@ -300,8 +299,7 @@
// set the language for the settings panel so that webfonts
// are correctly applied.
displaySettings.$template.attr( 'lang', langCode );
$.i18n().locale = langCode;
displaySettings.i18n();
displaySettings.preview( langCode );
},
quickList: function () {
return mw.uls.getFrequentLanguageList();
@@ -313,6 +311,20 @@
} );
},
/**
* Preview the settings panel in the given language
* @param {String} language Language code
*/
preview: function ( language ) {
var displaySettings = this,
i18n = $.i18n();
i18n.locale = language;
i18n.messageStore.load( i18n.locale ).done( function () {
displaySettings.i18n();
} );
},
/**
* Get previous languages
* @returns {Array}