Wikimedia Developer Support

$wgLanguageCode does not change Tools menu



I have 11 separate wikis all running off the same code base but with 11 databases and 11 (or more) LocalSettings.php files that get included according to the language/wiki ID at


I’d like to have the ‘Tools’ menu appear in the language of the wiki. So, if I visit the Spanish wiki, the Tools menu links would be in Spanish. No matter what setting I have for $wgLanguageCode, the links are in English (even browsing in incognito mode). I’ve flushed the language interface messages cache with
WIKI=en php /opt/htdocs/mediawiki/maintenance/rebuildmessages.php
WIKI=de php /opt/htdocs/mediawiki/maintenance/rebuildmessages.php
WIKI=es php /opt/htdocs/mediawiki/maintenance/rebuildmessages.php

The Tools Menu is properly translated if I append ?uselang=xx (where xx is ‘es’ for Spanish) to the URL Vis. example: However, I want the same behavior without manipulating the URL with ‘uselang’.

What am I missing? Why doesn’t $wgLanguageCode work as advertised?



2019년 3월 23일 (토) 01:44, Greg Rundlett via Wikimedia Developer Support noreply@discourse-mediawiki.wmflabs.org님이 작성:


Looks like your wiki is using the language preference of the browser of users viewing your site, because I see the tools menu of all three wikis in Spanish! I think this is a side effect of having the UniversalLanguageSelector extension installed


Confirmed. Disabling ULS results in the expected behavior where interface language is controlled by wgLanguageCode. Enabling ULS results in the interface language being controlled by the user’s browser settings (language preferences encoded in Accept headers).


Not so much a side effect as one of the main features (which wikis not heavily reliant on caching should probably enable). You can turn it off with $wgULSLanguageDetection = false; if you really want.


That’s what I though at first, but such an important feature is not even documented on the extension’s page…


Yeah, the doc page is not great. extension.json is usually a more reliable source of information.