launchULS: Add context to interface.language.change hook

Now that the interface.language.change hook is fired when the user
switches language using the Compact Language Switcher, we should provide
additional context to the UniversalLanguageSelector instrument.

Bug: T280770
Change-Id: I6c4ddf9738e527ac42581c9fb4924ed1d12748b4
This commit is contained in:
Sam Smith
2021-06-15 14:52:06 +01:00
committed by jenkins-bot
parent 8d4e548481
commit 3b9134f8ac

View File

@@ -61,7 +61,10 @@ function launchULS( $trigger, languagesObject, forCLS ) {
return;
}
mw.hook( 'mw.uls.interface.language.change' ).fire( language );
// TODO: The name of this hook should probably be changed to reflect that it covers
// both the user changing their interface language and the user switching to a
// different language.
mw.hook( 'mw.uls.interface.language.change' ).fire( language, 'content-language-switcher' );
location.href = languagesObject[ language ].href;
},