diff --git a/UniversalLanguageSelector.hooks.php b/UniversalLanguageSelector.hooks.php index feb07f79..d0fd1d73 100644 --- a/UniversalLanguageSelector.hooks.php +++ b/UniversalLanguageSelector.hooks.php @@ -125,7 +125,7 @@ class UniversalLanguageSelectorHooks { $out->addModules( 'ext.uls.compactlinks' ); } - if ( $wgULSGeoService ) { + if ( is_string( $wgULSGeoService ) ) { $out->addModules( 'ext.uls.geoclient' ); } @@ -309,10 +309,7 @@ class UniversalLanguageSelectorHooks { // Place constant stuff here (not depending on request context) - if ( $wgULSGeoService === true ) { - $wgULSGeoService = 'https://freegeoip.net/json/?callback=?'; - } - if ( $wgULSGeoService ) { + if ( is_string( $wgULSGeoService ) ) { $vars['wgULSGeoService'] = $wgULSGeoService; } diff --git a/extension.json b/extension.json index 2b48ade3..5902a78f 100644 --- a/extension.json +++ b/extension.json @@ -59,8 +59,8 @@ "compact-language-links": true }, "config": { - "@ULSGeoService": "ULS can use a geolocation service to suggest languages based on the country the user is vising from. If set to true, it will query a free geoip service. Setting this to false will prevent built-in geolocation from being used. You can provide your own geolocation by setting window.Geo to an object which has key \"country_code\" or \"country\".", - "ULSGeoService": true, + "@ULSGeoService": "ULS can use a geolocation service to suggest languages based on the country the user is vising from. If set to an URL it will query that service which must return an object which has key \"country_code\" or \"country\". For example https://api.ipstack.com/check?access_key=yourkey&fields=country_code. Setting this to false will prevent built-in geolocation from being used. You can also provide your own geolocation by assigning such object to window.Geo.", + "ULSGeoService": false, "@ULSEnable": "Enable language selection, compact language links, input methods and webfonts for everyone, unless the behavior is overridden by the configuration variables below. Even if false the classes and resource loader modules are registered for the use of other extensions. Language changing via cookie or setlang query parameter is not possible.", "ULSEnable": true, "@ULSEnableAnon": "Equivalent to $wgULSEnable for anonymous users only. Does not have any effect if $wgULSEnable is false.",