Remove use of navigator.userLanguage for IE11

Since MediaWiki 1.41 the Internet Explorer 11 has only Basic support:
https://www.mediawiki.org/wiki/Compatibility#Desktop

Change-Id: I4f4fb6532b0fe7aab9a3cb787deb4731d899bb53
This commit is contained in:
Fomafix
2024-10-21 19:05:35 +00:00
committed by jenkins-bot
parent 095a0ae3b6
commit 21a0a694cd

View File

@@ -181,10 +181,9 @@
*/ */
mw.uls.getBrowserLanguage = function () { mw.uls.getBrowserLanguage = function () {
// language is the standard property. // language is the standard property.
// userLanguage is only for IE and returns system locale.
// Empty string is a fallback in case both are undefined // Empty string is a fallback in case both are undefined
// to avoid runtime error with split(). // to avoid runtime error with split().
return ( window.navigator.language || window.navigator.userLanguage || '' ).split( '-' )[ 0 ]; return ( window.navigator.language || '' ).split( '-' )[ 0 ];
}; };
mw.uls.getCountryCode = function () { mw.uls.getCountryCode = function () {