Move i18n to Captcha modules own directory

1. change in preparation for ExtensionRegistration.

Bug: T88047
Change-Id: Ia3b84d3cb71832749ae73774dadb292dc4b9157b
This commit is contained in:
Florian 2015-05-21 17:32:51 +02:00
parent 129ee6328e
commit bd5c5d494e
461 changed files with 23 additions and 63 deletions

View file

@ -1,35 +0,0 @@
<?php
/**
* This is a backwards-compatibility shim, generated by:
* https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php
*
* Beginning with MediaWiki 1.23, translation strings are stored in json files,
* and the EXTENSION.i18n.php file only exists to provide compatibility with
* older releases of MediaWiki. For more information about this migration, see:
* https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format
*
* This shim maintains compatibility back to MediaWiki 1.17.
*/
$messages = array();
if ( !function_exists( 'wfJsonI18nShimd09f930cbcb3c1f3' ) ) {
function wfJsonI18nShimd09f930cbcb3c1f3( $cache, $code, &$cachedData ) {
$codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] );
foreach ( $codeSequence as $csCode ) {
$fileName = dirname( __FILE__ ) . "/i18n/core/$csCode.json";
if ( is_readable( $fileName ) ) {
$data = FormatJson::decode( file_get_contents( $fileName ), true );
foreach ( array_keys( $data ) as $key ) {
if ( $key === '' || $key[0] === '@' ) {
unset( $data[$key] );
}
}
$cachedData['messages'] = array_merge( $data, $cachedData['messages'] );
}
$cachedData['deps'][] = new FileDependency( $fileName );
}
return true;
}
$GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShimd09f930cbcb3c1f3';
}

View file

@ -177,10 +177,8 @@ $wgCaptchaRegexes = array();
/** Register special page */
$wgSpecialPages['Captcha'] = 'CaptchaSpecialPage';
$wgConfirmEditIP = __DIR__;
$wgMessagesDirs['ConfirmEdit'] = __DIR__ . '/i18n/core';
$wgExtensionMessagesFiles['ConfirmEdit'] = "$wgConfirmEditIP/ConfirmEdit.i18n.php";
$wgExtensionMessagesFiles['ConfirmEditAlias'] = "$wgConfirmEditIP/ConfirmEdit.alias.php";
$wgMessagesDirs['ConfirmEdit'] = __DIR__ . '/i18n';
$wgExtensionMessagesFiles['ConfirmEditAlias'] = __DIR__ . "/ConfirmEdit.alias.php";
$wgHooks['EditPageBeforeEditButtons'][] = 'ConfirmEditHooks::confirmEditPage';
$wgHooks['UserCreateForm'][] = 'ConfirmEditHooks::injectUserCreate';
@ -203,12 +201,12 @@ $wgHooks['AddNewAccountApiForm'][] = 'ConfirmEditHooks::addNewAccountApiForm';
$wgHooks['AddNewAccountApiResult'][] = 'ConfirmEditHooks::addNewAccountApiResult';
$wgHooks['UnitTestsList'][] = 'ConfirmEditHooks::onUnitTestsList';
$wgAutoloadClasses['ConfirmEditHooks'] = "$wgConfirmEditIP/ConfirmEditHooks.php";
$wgAutoloadClasses['SimpleCaptcha'] = "$wgConfirmEditIP/Captcha.php";
$wgAutoloadClasses['CaptchaStore'] = "$wgConfirmEditIP/CaptchaStore.php";
$wgAutoloadClasses['CaptchaSessionStore'] = "$wgConfirmEditIP/CaptchaStore.php";
$wgAutoloadClasses['CaptchaCacheStore'] = "$wgConfirmEditIP/CaptchaStore.php";
$wgAutoloadClasses['CaptchaSpecialPage'] = "$wgConfirmEditIP/ConfirmEditHooks.php";
$wgAutoloadClasses['ConfirmEditHooks'] = __DIR__ . '/ConfirmEditHooks.php';
$wgAutoloadClasses['SimpleCaptcha'] = __DIR__ . '/Captcha.php';
$wgAutoloadClasses['CaptchaStore'] = __DIR__ . '/CaptchaStore.php';
$wgAutoloadClasses['CaptchaSessionStore'] = __DIR__ . '/CaptchaStore.php';
$wgAutoloadClasses['CaptchaCacheStore'] = __DIR__ . '/CaptchaStore.php';
$wgAutoloadClasses['CaptchaSpecialPage'] = __DIR__ . '/ConfirmEditHooks.php';
/**
* Set up $wgWhitelistRead

View file

@ -29,8 +29,7 @@ if ( !defined( 'MEDIAWIKI' ) ) {
exit;
}
$dir = __DIR__;
require_once $dir . '/ConfirmEdit.php';
require_once __DIR__ . '/ConfirmEdit.php';
$wgCaptchaClass = 'FancyCaptcha';
/**
@ -56,20 +55,20 @@ $wgCaptchaSecret = "CHANGE_THIS_SECRET!";
*/
$wgCaptchaDeleteOnSolve = false;
$wgMessagesDirs['FancyCaptcha'] = __DIR__ . '/i18n/fancy';
$wgExtensionMessagesFiles['FancyCaptcha'] = $dir . '/FancyCaptcha.i18n.php';
$wgAutoloadClasses['FancyCaptcha'] = $dir . '/FancyCaptcha.class.php';
$wgMessagesDirs['FancyCaptcha'] = __DIR__ . '/FancyCaptcha/i18n';
$wgExtensionMessagesFiles['FancyCaptcha'] = __DIR__ . '/FancyCaptcha.i18n.php';
$wgAutoloadClasses['FancyCaptcha'] = __DIR__ . '/FancyCaptcha.class.php';
$wgResourceModules['ext.confirmEdit.fancyCaptcha.styles'] = array(
'position' => 'top',
'localBasePath' => $dir . '/resources',
'localBasePath' => __DIR__ . '/resources',
'remoteExtPath' => 'ConfirmEdit/resources',
'targets' => array( 'mobile', 'desktop' ),
'styles' => 'ext.confirmEdit.fancyCaptcha.css',
);
$wgResourceModules['ext.confirmEdit.fancyCaptcha'] = array(
'localBasePath' => $dir . '/resources',
'localBasePath' => __DIR__ . '/resources',
'remoteExtPath' => 'ConfirmEdit/resources',
'scripts' => 'ext.confirmEdit.fancyCaptcha.js',
'dependencies' => 'mediawiki.api',
@ -78,12 +77,12 @@ $wgResourceModules['ext.confirmEdit.fancyCaptcha'] = array(
// FIXME: remove, add mobile target to ext.confirmEdit.fancyCaptcha and update
// MobileFrontend accordingly when bug 57629 is resolved
$wgResourceModules['ext.confirmEdit.fancyCaptchaMobile'] = array(
'localBasePath' => $dir . '/resources',
'localBasePath' => __DIR__ . '/resources',
'remoteExtPath' => 'ConfirmEdit/resources',
'scripts' => 'ext.confirmEdit.fancyCaptcha.js',
'targets' => array( 'mobile', 'desktop' ),
'dependencies' => 'mobile.startup',
);
$wgAutoloadClasses['ApiFancyCaptchaReload'] = $dir . '/ApiFancyCaptchaReload.php';
$wgAutoloadClasses['ApiFancyCaptchaReload'] = __DIR__ . '/ApiFancyCaptchaReload.php';
$wgAPIModules['fancycaptchareload'] = 'ApiFancyCaptchaReload';

Some files were not shown because too many files have changed in this diff Show more