diff options
Diffstat (limited to 'extensions/LocalisationUpdate')
-rw-r--r-- | extensions/LocalisationUpdate/Autoload.php | 35 | ||||
-rw-r--r-- | extensions/LocalisationUpdate/Gruntfile.js | 19 | ||||
-rw-r--r-- | extensions/LocalisationUpdate/LocalisationUpdate.php | 21 | ||||
-rw-r--r-- | extensions/LocalisationUpdate/composer.json | 47 | ||||
-rw-r--r-- | extensions/LocalisationUpdate/extension.json | 4 |
5 files changed, 96 insertions, 30 deletions
diff --git a/extensions/LocalisationUpdate/Autoload.php b/extensions/LocalisationUpdate/Autoload.php index 0b3f14dc..8be7124a 100644 --- a/extensions/LocalisationUpdate/Autoload.php +++ b/extensions/LocalisationUpdate/Autoload.php @@ -5,27 +5,24 @@ * @license GPL-2.0+ */ -global $wgAutoloadClasses; $dir = __DIR__; -$wgAutoloadClasses += array( - 'LocalisationUpdate' => "$dir/LocalisationUpdate.class.php", - 'LU_Updater' => "$dir/Updater.php", - 'QuickArrayReader' => "$dir/QuickArrayReader.php", +$GLOBALS['wgAutoloadClasses']['LocalisationUpdate'] = "$dir/LocalisationUpdate.class.php"; +$GLOBALS['wgAutoloadClasses']['LU_Updater'] = "$dir/Updater.php"; +$GLOBALS['wgAutoloadClasses']['QuickArrayReader'] = "$dir/QuickArrayReader.php"; - # fetcher - 'LU_Fetcher' => "$dir/fetcher/Fetcher.php", - 'LU_FetcherFactory' => "$dir/fetcher/FetcherFactory.php", - 'LU_FileSystemFetcher' => "$dir/fetcher/FileSystemFetcher.php", - 'LU_GitHubFetcher' => "$dir/fetcher/GitHubFetcher.php", - 'LU_HttpFetcher' => "$dir/fetcher/HttpFetcher.php", +# fetcher +$GLOBALS['wgAutoloadClasses']['LU_Fetcher'] = "$dir/fetcher/Fetcher.php"; +$GLOBALS['wgAutoloadClasses']['LU_FetcherFactory'] = "$dir/fetcher/FetcherFactory.php"; +$GLOBALS['wgAutoloadClasses']['LU_FileSystemFetcher'] = "$dir/fetcher/FileSystemFetcher.php"; +$GLOBALS['wgAutoloadClasses']['LU_GitHubFetcher'] = "$dir/fetcher/GitHubFetcher.php"; +$GLOBALS['wgAutoloadClasses']['LU_HttpFetcher'] = "$dir/fetcher/HttpFetcher.php"; - # finder - 'LU_Finder' => "$dir/finder/Finder.php", +# finder +$GLOBALS['wgAutoloadClasses']['LU_Finder'] = "$dir/finder/Finder.php"; - # reader - 'LU_JSONReader' => "$dir/reader/JSONReader.php", - 'LU_PHPReader' => "$dir/reader/PHPReader.php", - 'LU_Reader' => "$dir/reader/Reader.php", - 'LU_ReaderFactory' => "$dir/reader/ReaderFactory.php", -); +# reader +$GLOBALS['wgAutoloadClasses']['LU_JSONReader'] = "$dir/reader/JSONReader.php"; +$GLOBALS['wgAutoloadClasses']['LU_PHPReader'] = "$dir/reader/PHPReader.php"; +$GLOBALS['wgAutoloadClasses']['LU_Reader'] = "$dir/reader/Reader.php"; +$GLOBALS['wgAutoloadClasses']['LU_ReaderFactory'] = "$dir/reader/ReaderFactory.php"; diff --git a/extensions/LocalisationUpdate/Gruntfile.js b/extensions/LocalisationUpdate/Gruntfile.js new file mode 100644 index 00000000..5a87e7b6 --- /dev/null +++ b/extensions/LocalisationUpdate/Gruntfile.js @@ -0,0 +1,19 @@ +/*jshint node:true */ +module.exports = function ( grunt ) { + grunt.loadNpmTasks( 'grunt-banana-checker' ); + grunt.loadNpmTasks( 'grunt-jsonlint' ); + + var conf = grunt.file.readJSON( 'extension.json' ); + grunt.initConfig( { + banana: conf.MessagesDirs, + jsonlint: { + all: [ + '**/*.json', + '!node_modules/**' + ] + } + } ); + + grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] ); + grunt.registerTask( 'default', 'test' ); +}; diff --git a/extensions/LocalisationUpdate/LocalisationUpdate.php b/extensions/LocalisationUpdate/LocalisationUpdate.php index 6548a3c6..63161c17 100644 --- a/extensions/LocalisationUpdate/LocalisationUpdate.php +++ b/extensions/LocalisationUpdate/LocalisationUpdate.php @@ -3,7 +3,7 @@ if ( function_exists( 'wfLoadExtension' ) ) { wfLoadExtension( 'LocalisationUpdate' ); // Keep i18n globals so mergeMessageFileList.php doesn't break - $wgMessagesDirs['LocalisationUpdate'] = __DIR__ . '/i18n'; + $GLOBALS['wgMessagesDirs']['LocalisationUpdate'] = __DIR__ . '/i18n'; /* wfWarn( 'Deprecated PHP entry point used for LocalisationUpdate extension. Please use wfLoadExtension instead, ' . 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' @@ -22,20 +22,20 @@ if ( function_exists( 'wfLoadExtension' ) ) { * NOTE: If this variable and $wgCacheDirectory are both false, this extension * WILL NOT WORK. */ -$wgLocalisationUpdateDirectory = false; +$GLOBALS['wgLocalisationUpdateDirectory'] = false; /** * Default repository source to use. * @since 2014-03 */ -$wgLocalisationUpdateRepository = 'github'; +$GLOBALS['wgLocalisationUpdateRepository'] = 'github'; /** * Available repository sources. * @since 2014-03 */ -$wgLocalisationUpdateRepositories = array(); -$wgLocalisationUpdateRepositories['github'] = array( +$GLOBALS['wgLocalisationUpdateRepositories'] = array(); +$GLOBALS['wgLocalisationUpdateRepositories']['github'] = array( 'mediawiki' => 'https://raw.github.com/wikimedia/mediawiki/master/%PATH%', 'extension' => @@ -54,21 +54,22 @@ $wgLocalisationUpdateRepositories['github'] = array( # 'file:///resources/projects/mediawiki-skins/skins/%NAME%/%PATH%', #); -$wgExtensionCredits['other'][] = array( +$GLOBALS['wgExtensionCredits']['other'][] = array( 'path' => __FILE__, 'name' => 'LocalisationUpdate', 'author' => array( 'Tom Maaswinkel', 'Niklas Laxström', 'Roan Kattouw' ), 'version' => '1.3.0', 'url' => 'https://www.mediawiki.org/wiki/Extension:LocalisationUpdate', 'descriptionmsg' => 'localisationupdate-desc', + 'license-name' => 'GPL-2.0+', ); -$wgHooks['LocalisationCacheRecache'][] = 'LocalisationUpdate::onRecache'; -$wgHooks['LocalisationCacheRecacheFallback'][] = 'LocalisationUpdate::onRecacheFallback'; $GLOBALS['wgHooks']['UnitTestsList'][] = 'LocalisationUpdate::setupUnitTests'; +$GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'LocalisationUpdate::onRecache'; +$GLOBALS['wgHooks']['LocalisationCacheRecacheFallback'][] = 'LocalisationUpdate::onRecacheFallback'; $dir = __DIR__; -$wgMessagesDirs['LocalisationUpdate'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['LocalisationUpdate'] = "$dir/LocalisationUpdate.i18n.php"; +$GLOBALS['wgMessagesDirs']['LocalisationUpdate'] = __DIR__ . '/i18n'; +$GLOBALS['wgExtensionMessagesFiles']['LocalisationUpdate'] = "$dir/LocalisationUpdate.i18n.php"; require "$dir/Autoload.php"; diff --git a/extensions/LocalisationUpdate/composer.json b/extensions/LocalisationUpdate/composer.json new file mode 100644 index 00000000..6a626250 --- /dev/null +++ b/extensions/LocalisationUpdate/composer.json @@ -0,0 +1,47 @@ +{ + "name": "mediawiki/localisation-update", + "type": "mediawiki-extension", + "description": "MediaWiki extension to keep the localised messages as up to date as possible.", + "keywords": [ + "MediaWiki", + "l10n", + "localization" + ], + "homepage": "https://www.mediawiki.org/wiki/Extension:LocalisationUpdate", + "license": "GPL-2.0+", + "authors": [ + { + "name": "Roan Kattouw", + "email": "roan.kattouw@gmail.com", + "role": "Developer" + }, + { + "name": "Niklas Laxström", + "email": "niklas.laxstrom@gmail.com", + "role": "Developer" + }, + { + "name": "Tom Maaswinkel", + "role": "Original author" + } + ], + "support": { + "issues": "https://phabricator.wikimedia.org/", + "irc": "irc://irc.freenode.net/mediawiki", + "forum": "https://www.mediawiki.org/wiki/Extension_talk:LocalisationUpdate", + "wiki": "https://www.mediawiki.org/wiki/Extension:LocalisationUpdate" + }, + "autoload": { + "files": [ + "LocalisationUpdate.php" + ] + }, + "require-dev": { + "jakub-onderka/php-parallel-lint": "0.9" + }, + "scripts": { + "test": [ + "parallel-lint . --exclude node_modules --exclude vendor" + ] + } +} diff --git a/extensions/LocalisationUpdate/extension.json b/extensions/LocalisationUpdate/extension.json index 43262f09..0ab5d060 100644 --- a/extensions/LocalisationUpdate/extension.json +++ b/extensions/LocalisationUpdate/extension.json @@ -9,6 +9,7 @@ ], "url": "https://www.mediawiki.org/wiki/Extension:LocalisationUpdate", "descriptionmsg": "localisationupdate-desc", + "license-name": "GPL-2.0+", "type": "other", "MessagesDirs": { "LocalisationUpdate": [ @@ -51,5 +52,6 @@ "skin": "https://raw.github.com/wikimedia/mediawiki-skins-%NAME%/master/%PATH%" } } - } + }, + "manifest_version": 1 } |