Merge "Prepare for composer"
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
* JavaScript and CSS resource definitions.
|
* JavaScript and CSS resource definitions.
|
||||||
*
|
*
|
||||||
* @file
|
* @file
|
||||||
* @license GPL2+
|
* @license GPL-2.0+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$resourcePaths = array(
|
$resourcePaths = array(
|
||||||
@@ -11,6 +11,7 @@ $resourcePaths = array(
|
|||||||
'remoteExtPath' => 'UniversalLanguageSelector'
|
'remoteExtPath' => 'UniversalLanguageSelector'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
global $wgResourceModules;
|
||||||
$wgResourceModules['ext.uls.languagenames'] = array(
|
$wgResourceModules['ext.uls.languagenames'] = array(
|
||||||
'class' => 'ResourceLoaderULSModule'
|
'class' => 'ResourceLoaderULSModule'
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ if ( !defined( 'MEDIAWIKI' ) ) {
|
|||||||
*/
|
*/
|
||||||
define( 'ULS_VERSION', '2013-12-31' );
|
define( 'ULS_VERSION', '2013-12-31' );
|
||||||
|
|
||||||
$wgExtensionCredits['other'][] = array(
|
$GLOBALS['wgExtensionCredits']['other'][] = array(
|
||||||
'path' => __FILE__,
|
'path' => __FILE__,
|
||||||
'name' => 'UniversalLanguageSelector',
|
'name' => 'UniversalLanguageSelector',
|
||||||
'version' => ULS_VERSION,
|
'version' => ULS_VERSION,
|
||||||
@@ -54,7 +54,7 @@ $wgExtensionCredits['other'][] = array(
|
|||||||
*
|
*
|
||||||
* The service should return jsonp that uses the supplied callback parameter.
|
* The service should return jsonp that uses the supplied callback parameter.
|
||||||
*/
|
*/
|
||||||
$wgULSGeoService = true;
|
$GLOBALS['wgULSGeoService'] = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable language selection, input methods and webfonts for everyone, unless
|
* Enable language selection, input methods and webfonts for everyone, unless
|
||||||
@@ -64,14 +64,14 @@ $wgULSGeoService = true;
|
|||||||
* use of other extensions. Language changing via cookie or setlang query
|
* use of other extensions. Language changing via cookie or setlang query
|
||||||
* parameter is not possible.
|
* parameter is not possible.
|
||||||
*/
|
*/
|
||||||
$wgULSEnable = true;
|
$GLOBALS['wgULSEnable'] = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Equivalent to $wgULSEnable for anonymous users only.
|
* Equivalent to $wgULSEnable for anonymous users only.
|
||||||
*
|
*
|
||||||
* Does not have any effect if $wgULSEnable is false.
|
* Does not have any effect if $wgULSEnable is false.
|
||||||
*/
|
*/
|
||||||
$wgULSEnableAnon = true;
|
$GLOBALS['wgULSEnableAnon'] = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allow anonymous users to change language with cookie and setlang
|
* Allow anonymous users to change language with cookie and setlang
|
||||||
@@ -85,7 +85,7 @@ $wgULSEnableAnon = true;
|
|||||||
*
|
*
|
||||||
* @since 2013.04
|
* @since 2013.04
|
||||||
*/
|
*/
|
||||||
$wgULSAnonCanChangeLanguage = true;
|
$GLOBALS['wgULSAnonCanChangeLanguage'] = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Try to use preferred interface language for anonymous users.
|
* Try to use preferred interface language for anonymous users.
|
||||||
@@ -96,19 +96,19 @@ $wgULSAnonCanChangeLanguage = true;
|
|||||||
* Does not have any effect if any of $wgULSEnable, $wgULSEnableAnon
|
* Does not have any effect if any of $wgULSEnable, $wgULSEnableAnon
|
||||||
* or $wgULSAnonCanChangeLanguage is set to false.
|
* or $wgULSAnonCanChangeLanguage is set to false.
|
||||||
*/
|
*/
|
||||||
$wgULSLanguageDetection = true;
|
$GLOBALS['wgULSLanguageDetection'] = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disable the input methods feature for all users by default. Can still
|
* Disable the input methods feature for all users by default. Can still
|
||||||
* be enabled manually by the user.
|
* be enabled manually by the user.
|
||||||
*/
|
*/
|
||||||
$wgULSIMEEnabled = true;
|
$GLOBALS['wgULSIMEEnabled'] = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set whether webfont support is loaded within the mobile interface (via the
|
* Set whether webfont support is loaded within the mobile interface (via the
|
||||||
* MobileFrontend extension).
|
* MobileFrontend extension).
|
||||||
*/
|
*/
|
||||||
$wgULSMobileWebfontsEnabled = false;
|
$GLOBALS['wgULSMobileWebfontsEnabled'] = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The location and the form of the language selection trigger.
|
* The location and the form of the language selection trigger.
|
||||||
@@ -120,21 +120,21 @@ $wgULSMobileWebfontsEnabled = false;
|
|||||||
*
|
*
|
||||||
* @since 2013.04
|
* @since 2013.04
|
||||||
*/
|
*/
|
||||||
$wgULSPosition = 'personal';
|
$GLOBALS['wgULSPosition'] = 'personal';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether to use EventLogging. The EventLogging extension must be installed
|
* Whether to use EventLogging. The EventLogging extension must be installed
|
||||||
* if this option is enabled.
|
* if this option is enabled.
|
||||||
* @since 2013.06
|
* @since 2013.06
|
||||||
*/
|
*/
|
||||||
$wgULSEventLogging = false;
|
$GLOBALS['wgULSEventLogging'] = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array of jQuery selectors of elements on which IME should be enabled.
|
* Array of jQuery selectors of elements on which IME should be enabled.
|
||||||
*
|
*
|
||||||
* @since 2013.11
|
* @since 2013.11
|
||||||
*/
|
*/
|
||||||
$wgULSImeSelectors = array(
|
$GLOBALS['wgULSImeSelectors'] = array(
|
||||||
'input:not([type])',
|
'input:not([type])',
|
||||||
'input[type=text]',
|
'input[type=text]',
|
||||||
'input[type=search]',
|
'input[type=search]',
|
||||||
@@ -147,7 +147,7 @@ $wgULSImeSelectors = array(
|
|||||||
*
|
*
|
||||||
* @since 2013.07
|
* @since 2013.07
|
||||||
*/
|
*/
|
||||||
$wgULSNoImeSelectors = array( '#wpCaptchaWord', '.ve-ce-documentNode' );
|
$GLOBALS['wgULSNoImeSelectors'] = array( '#wpCaptchaWord', '.ve-ce-documentNode' );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array of jQuery selectors of elements on which webfonts must not be applied.
|
* Array of jQuery selectors of elements on which webfonts must not be applied.
|
||||||
@@ -155,7 +155,7 @@ $wgULSNoImeSelectors = array( '#wpCaptchaWord', '.ve-ce-documentNode' );
|
|||||||
* Autonym
|
* Autonym
|
||||||
* @since 2013.09
|
* @since 2013.09
|
||||||
*/
|
*/
|
||||||
$wgULSNoWebfontsSelectors = array( '.autonym' );
|
$GLOBALS['wgULSNoWebfontsSelectors'] = array( '.autonym' );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base path of ULS font repository.
|
* Base path of ULS font repository.
|
||||||
@@ -163,14 +163,14 @@ $wgULSNoWebfontsSelectors = array( '.autonym' );
|
|||||||
* relative to $wgExtensionAssetsPath.
|
* relative to $wgExtensionAssetsPath.
|
||||||
* @since 2013.10
|
* @since 2013.10
|
||||||
*/
|
*/
|
||||||
$wgULSFontRepositoryBasePath = false;
|
$GLOBALS['wgULSFontRepositoryBasePath'] = false;
|
||||||
|
|
||||||
// Internationalization
|
// Internationalization
|
||||||
$wgExtensionMessagesFiles['UniversalLanguageSelector'] =
|
$GLOBALS['wgExtensionMessagesFiles']['UniversalLanguageSelector'] =
|
||||||
__DIR__ . '/UniversalLanguageSelector.i18n.php';
|
__DIR__ . '/UniversalLanguageSelector.i18n.php';
|
||||||
|
|
||||||
// Register auto load for the page class
|
// Register auto load for the page class
|
||||||
$wgAutoloadClasses += array(
|
$GLOBALS['wgAutoloadClasses'] += array(
|
||||||
'UniversalLanguageSelectorHooks' => __DIR__ . '/UniversalLanguageSelector.hooks.php',
|
'UniversalLanguageSelectorHooks' => __DIR__ . '/UniversalLanguageSelector.hooks.php',
|
||||||
'ResourceLoaderULSModule' => __DIR__ . '/includes/ResourceLoaderULSModule.php',
|
'ResourceLoaderULSModule' => __DIR__ . '/includes/ResourceLoaderULSModule.php',
|
||||||
'ResourceLoaderULSJsonMessageModule' =>
|
'ResourceLoaderULSJsonMessageModule' =>
|
||||||
@@ -181,22 +181,23 @@ $wgAutoloadClasses += array(
|
|||||||
'LanguageNameSearch' => __DIR__ . '/data/LanguageNameSearch.php',
|
'LanguageNameSearch' => __DIR__ . '/data/LanguageNameSearch.php',
|
||||||
);
|
);
|
||||||
|
|
||||||
$wgHooks['BeforePageDisplay'][] = 'UniversalLanguageSelectorHooks::addModules';
|
$GLOBALS['wgHooks']['BeforePageDisplay'][] = 'UniversalLanguageSelectorHooks::addModules';
|
||||||
$wgHooks['PersonalUrls'][] = 'UniversalLanguageSelectorHooks::addPersonalBarTrigger';
|
$GLOBALS['wgHooks']['PersonalUrls'][] = 'UniversalLanguageSelectorHooks::addPersonalBarTrigger';
|
||||||
$wgHooks['ResourceLoaderTestModules'][] = 'UniversalLanguageSelectorHooks::addTestModules';
|
$GLOBALS['wgHooks']['ResourceLoaderTestModules'][] =
|
||||||
$wgHooks['ResourceLoaderGetConfigVars'][] = 'UniversalLanguageSelectorHooks::addConfig';
|
'UniversalLanguageSelectorHooks::addTestModules';
|
||||||
$wgHooks['MakeGlobalVariablesScript'][] = 'UniversalLanguageSelectorHooks::addVariables';
|
$GLOBALS['wgHooks']['ResourceLoaderGetConfigVars'][] = 'UniversalLanguageSelectorHooks::addConfig';
|
||||||
$wgAPIModules['languagesearch'] = 'ApiLanguageSearch';
|
$GLOBALS['wgHooks']['MakeGlobalVariablesScript'][] = 'UniversalLanguageSelectorHooks::addVariables';
|
||||||
$wgAPIModules['ulslocalization'] = 'ApiULSLocalization';
|
$GLOBALS['wgAPIModules']['languagesearch'] = 'ApiLanguageSearch';
|
||||||
$wgHooks['UserGetLanguageObject'][] = 'UniversalLanguageSelectorHooks::getLanguage';
|
$GLOBALS['wgAPIModules']['ulslocalization'] = 'ApiULSLocalization';
|
||||||
$wgHooks['SkinTemplateOutputPageBeforeExec'][] =
|
$GLOBALS['wgHooks']['UserGetLanguageObject'][] = 'UniversalLanguageSelectorHooks::getLanguage';
|
||||||
|
$GLOBALS['wgHooks']['SkinTemplateOutputPageBeforeExec'][] =
|
||||||
'UniversalLanguageSelectorHooks::onSkinTemplateOutputPageBeforeExec';
|
'UniversalLanguageSelectorHooks::onSkinTemplateOutputPageBeforeExec';
|
||||||
$wgHooks['EnterMobileMode'][] = 'UniversalLanguageSelectorHooks::onEnterMobileMode';
|
$GLOBALS['wgHooks']['EnterMobileMode'][] = 'UniversalLanguageSelectorHooks::onEnterMobileMode';
|
||||||
|
|
||||||
$wgDefaultUserOptions['uls-preferences'] = '';
|
$GLOBALS['wgDefaultUserOptions']['uls-preferences'] = '';
|
||||||
$wgHooks['GetPreferences'][] = 'UniversalLanguageSelectorHooks::onGetPreferences';
|
$GLOBALS['wgHooks']['GetPreferences'][] = 'UniversalLanguageSelectorHooks::onGetPreferences';
|
||||||
|
|
||||||
$wgExtensionFunctions[] = function () {
|
$GLOBALS['wgExtensionFunctions'][] = function () {
|
||||||
global $wgHooks, $wgResourceModules, $wgULSEventLogging, $wgULSGeoService;
|
global $wgHooks, $wgResourceModules, $wgULSEventLogging, $wgULSGeoService;
|
||||||
|
|
||||||
if ( $wgULSGeoService === true ) {
|
if ( $wgULSGeoService === true ) {
|
||||||
|
|||||||
27
composer.json
Normal file
27
composer.json
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"name": "mediawiki/universal-language-selector",
|
||||||
|
"type": "mediawiki-extension",
|
||||||
|
"description": "The primary aim is to allow users to select a language and configure its support in an easy way. Main features are language selection, input methods and web fonts.",
|
||||||
|
"keywords": [
|
||||||
|
"MediaWiki",
|
||||||
|
"Language selection",
|
||||||
|
"Input methods",
|
||||||
|
"Web fonts"
|
||||||
|
],
|
||||||
|
"homepage": "https://www.mediawiki.org/wiki/Extension:UniversalLanguageSelector",
|
||||||
|
"license": [ "GPL-2.0+", "MIT" ],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://bugzilla.wikimedia.org/",
|
||||||
|
"irc": "irc://irc.freenode.net/mediawiki-i18n",
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.0",
|
||||||
|
"composer/installers": ">=1.0.1"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"mediawiki/cldr": "Language names in all languages."
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"files": ["UniversalLanguageSelector.php"]
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user