Initial version of geolocation support

Change-Id: Ia1a18ac336131520bbc67f52194f4aa9c547ea67
This commit is contained in:
Niklas Laxström
2012-08-30 10:23:59 +00:00
committed by Amir E. Aharoni
parent fde6b18e40
commit 64c26ad137
6 changed files with 63 additions and 9 deletions

View File

@@ -25,7 +25,7 @@ if ( !defined( 'MEDIAWIKI' ) ) {
/**
* Version number used in extension credits and in other placed where needed.
*/
define( 'ULS_VERSION', '2012-07-20' );
define( 'ULS_VERSION', '2012-08-30' );
$wgExtensionCredits['other'][] = array(
'path' => __FILE__,
@@ -45,6 +45,17 @@ $wgExtensionCredits['other'][] = array(
'descriptionmsg' => 'uls-desc',
);
/**
* ULS can use geolocation services to suggest languages based on the
* country the user is vising from. Setting this to false will prevent
* builtin geolocation from being used. You can provide your own geolocation
* by setting window.GEO to object which has key country_code. This is what
* Wikipedia does.
*
* The service should return jsonp that uses the supplied callback parameter.
*/
$wgULSGeoService = 'http://freegeoip.net/json/';
$dir = __DIR__ ;
// Internationalization
@@ -77,6 +88,12 @@ $wgResourceModules['ext.uls.init'] = array(
'position' => 'top',
);
$wgResourceModules['ext.uls.geoclient'] = array(
'scripts' => 'resources/js/ext.uls.geoclient.js',
'localBasePath' => $dir,
'remoteExtPath' => 'UniversalLanguageSelector',
);
$wgResourceModules['ext.uls.preferences'] = array(
'scripts' => 'resources/js/ext.uls.preferences.js',
'localBasePath' => $dir,