Regression: Using [...] to change language does not activate apply button
Bug: 53736 Change-Id: If52beb73f9f3f74cde63bd846974540682066ab6
This commit is contained in:
committed by
Nemo bis
parent
ba065b586c
commit
e36d9b1cc3
@@ -107,8 +107,13 @@
|
||||
this.prepareLanguages();
|
||||
this.prepareUIFonts();
|
||||
this.prepareContentFonts();
|
||||
|
||||
// Usually this is already loaded, but when changing language it
|
||||
// might not be.
|
||||
$.i18n().locale = this.uiLanguage;
|
||||
this.i18n();
|
||||
mw.uls.loadLocalization( this.uiLanguage )
|
||||
.done( $.proxy( this.i18n, this ) );
|
||||
|
||||
this.$webfonts.refresh();
|
||||
this.listen();
|
||||
this.dirty = false;
|
||||
@@ -316,15 +321,13 @@
|
||||
}
|
||||
},
|
||||
onSelect: function ( langCode ) {
|
||||
displaySettings.markDirty();
|
||||
displaySettings.uiLanguage = langCode;
|
||||
displaySettings.$parent.show();
|
||||
displaySettings.prepareUIFonts();
|
||||
displaySettings.prepareLanguages();
|
||||
// set the language for the settings panel so that webfonts
|
||||
// are correctly applied.
|
||||
displaySettings.$template.attr( 'lang', langCode );
|
||||
displaySettings.preview( langCode );
|
||||
// This re-renders the whole thing
|
||||
displaySettings.$parent.show();
|
||||
// And the only thing we need to take care of is to enable
|
||||
// the apply button
|
||||
displaySettings.markDirty();
|
||||
},
|
||||
quickList: function () {
|
||||
return mw.uls.getFrequentLanguageList();
|
||||
|
||||
@@ -31,6 +31,15 @@ Given(/^the content language is "(.*?)"$/) do |language|
|
||||
actual.should == code
|
||||
end
|
||||
|
||||
Given(/^the interface language is "(.*?)"$/) do |language|
|
||||
# phantomjs needs little bit time because it executes the script before
|
||||
# the page is fully loaded
|
||||
sleep 0.5;
|
||||
code = language_to_code(language)
|
||||
actual = @browser.execute_script( "return mw.config.get( 'wgUserLanguage' )" )
|
||||
actual.should == code
|
||||
end
|
||||
|
||||
def language_to_code(language)
|
||||
case language
|
||||
when 'German'
|
||||
|
||||
@@ -63,3 +63,13 @@ Feature: ULS settings panel
|
||||
Given I temporarily use "Finnish" as the interface language
|
||||
When I open "Language" panel of language settings
|
||||
Then I see "English (sama kuin sisällön)" as the name of the content language
|
||||
|
||||
@login @reset-preferences-after
|
||||
Scenario: Selecting language via [...] button
|
||||
|
||||
Given I am logged in
|
||||
When I open "Language" panel of language settings
|
||||
And I click the button with the ellipsis
|
||||
And I use the panel to change my interface language to "German"
|
||||
And I apply the changes
|
||||
Then the interface language is "German"
|
||||
|
||||
Reference in New Issue
Block a user