Use wmf geoip by default

Unlike freegeoip it also works with https

Also moved the getCountryCode function to init, as it should be
available regardless of whether we load the optional geoclient
module.

Bug: 40965
Change-Id: Ia18130890d09f86a93b5b61f7da7c48fcfa480c7
This commit is contained in:
Niklas Laxström authored and Amir E. Aharoni committed 2013-04-28 14:25:26 +03:00
1 parent 7416740f95
commit 60242e2c53
5 files changed
+29 -9

No files matched your search

+10 -2
View File
@@ -41,9 +41,15 @@ class UniversalLanguageSelectorHooks {
* @return bool
*/
public static function addModules( $out, $skin ) {
global $wgULSGeoService;
// If extension is enabled, basic features(API, language data) available.
$out->addModules( 'ext.uls.init' );
$out->addModules( 'ext.uls.geoclient' );
if ( is_string( $wgULSGeoService ) ) {
$out->addModules( 'ext.uls.geoclient' );
}
if ( self::isToolbarEnabled( $out->getUser() ) ) {
// Enable UI language selection for the user.
$out->addModules( 'ext.uls.interface' );
@@ -224,7 +230,9 @@ class UniversalLanguageSelectorHooks {
$wgULSAnonCanChangeLanguage;
// Place constant stuff here (not depending on request context)
$vars['wgULSGeoService'] = $wgULSGeoService;
if ( is_string( $wgULSGeoService ) ) {
$vars['wgULSGeoService'] = $wgULSGeoService;
}
$vars['wgULSIMEEnabled'] = $wgULSIMEEnabled;
$vars['wgULSPosition'] = $wgULSPosition;
$vars['wgULSAnonCanChangeLanguage'] = $wgULSAnonCanChangeLanguage;