Reset language and font while preview

If not reset, the font-family will persist for languages
without font preferences

Steps to reproduce:
1. Open language settings->Display settings.
Switch language to English. Inspect the lang and font-family
of uls-display-settings element.

2. Switch language to hi. Inspect the lang and font-family
of uls-display-settings element. You can see Lohit Devanagari
as font.

3. Switch the language back to English. You can still see font
as Lohit Devanagari. With this patch, you should see font family
reset for English.

Change-Id: Ib3346d8b888c7dcfda16e8a10473c785a1ebd890
This commit is contained in:
Santhosh Thottingal
2013-09-30 10:59:28 +05:30
parent 32bb03045f
commit b4f794f9fe

View File

@@ -337,7 +337,9 @@
*/
preview: function ( language ) {
var displaySettings = this;
this.$template.attr( 'lang', language );
// Reset the language and font for the panel.
this.$template.attr( 'lang', language )
.css( 'font-family', '' );
$.i18n().locale = language;
mw.uls.loadLocalization( language ).done( function () {
displaySettings.i18n();