mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-23 15:56:50 +00:00
Move i18n to Captcha modules own directory
1. change in preparation for ExtensionRegistration. Bug: T88047 Change-Id: Ia3b84d3cb71832749ae73774dadb292dc4b9157b
This commit is contained in:
parent
129ee6328e
commit
bd5c5d494e
|
@ -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';
|
|
||||||
}
|
|
|
@ -177,10 +177,8 @@ $wgCaptchaRegexes = array();
|
||||||
/** Register special page */
|
/** Register special page */
|
||||||
$wgSpecialPages['Captcha'] = 'CaptchaSpecialPage';
|
$wgSpecialPages['Captcha'] = 'CaptchaSpecialPage';
|
||||||
|
|
||||||
$wgConfirmEditIP = __DIR__;
|
$wgMessagesDirs['ConfirmEdit'] = __DIR__ . '/i18n';
|
||||||
$wgMessagesDirs['ConfirmEdit'] = __DIR__ . '/i18n/core';
|
$wgExtensionMessagesFiles['ConfirmEditAlias'] = __DIR__ . "/ConfirmEdit.alias.php";
|
||||||
$wgExtensionMessagesFiles['ConfirmEdit'] = "$wgConfirmEditIP/ConfirmEdit.i18n.php";
|
|
||||||
$wgExtensionMessagesFiles['ConfirmEditAlias'] = "$wgConfirmEditIP/ConfirmEdit.alias.php";
|
|
||||||
|
|
||||||
$wgHooks['EditPageBeforeEditButtons'][] = 'ConfirmEditHooks::confirmEditPage';
|
$wgHooks['EditPageBeforeEditButtons'][] = 'ConfirmEditHooks::confirmEditPage';
|
||||||
$wgHooks['UserCreateForm'][] = 'ConfirmEditHooks::injectUserCreate';
|
$wgHooks['UserCreateForm'][] = 'ConfirmEditHooks::injectUserCreate';
|
||||||
|
@ -203,12 +201,12 @@ $wgHooks['AddNewAccountApiForm'][] = 'ConfirmEditHooks::addNewAccountApiForm';
|
||||||
$wgHooks['AddNewAccountApiResult'][] = 'ConfirmEditHooks::addNewAccountApiResult';
|
$wgHooks['AddNewAccountApiResult'][] = 'ConfirmEditHooks::addNewAccountApiResult';
|
||||||
$wgHooks['UnitTestsList'][] = 'ConfirmEditHooks::onUnitTestsList';
|
$wgHooks['UnitTestsList'][] = 'ConfirmEditHooks::onUnitTestsList';
|
||||||
|
|
||||||
$wgAutoloadClasses['ConfirmEditHooks'] = "$wgConfirmEditIP/ConfirmEditHooks.php";
|
$wgAutoloadClasses['ConfirmEditHooks'] = __DIR__ . '/ConfirmEditHooks.php';
|
||||||
$wgAutoloadClasses['SimpleCaptcha'] = "$wgConfirmEditIP/Captcha.php";
|
$wgAutoloadClasses['SimpleCaptcha'] = __DIR__ . '/Captcha.php';
|
||||||
$wgAutoloadClasses['CaptchaStore'] = "$wgConfirmEditIP/CaptchaStore.php";
|
$wgAutoloadClasses['CaptchaStore'] = __DIR__ . '/CaptchaStore.php';
|
||||||
$wgAutoloadClasses['CaptchaSessionStore'] = "$wgConfirmEditIP/CaptchaStore.php";
|
$wgAutoloadClasses['CaptchaSessionStore'] = __DIR__ . '/CaptchaStore.php';
|
||||||
$wgAutoloadClasses['CaptchaCacheStore'] = "$wgConfirmEditIP/CaptchaStore.php";
|
$wgAutoloadClasses['CaptchaCacheStore'] = __DIR__ . '/CaptchaStore.php';
|
||||||
$wgAutoloadClasses['CaptchaSpecialPage'] = "$wgConfirmEditIP/ConfirmEditHooks.php";
|
$wgAutoloadClasses['CaptchaSpecialPage'] = __DIR__ . '/ConfirmEditHooks.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up $wgWhitelistRead
|
* Set up $wgWhitelistRead
|
||||||
|
|
|
@ -29,8 +29,7 @@ if ( !defined( 'MEDIAWIKI' ) ) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$dir = __DIR__;
|
require_once __DIR__ . '/ConfirmEdit.php';
|
||||||
require_once $dir . '/ConfirmEdit.php';
|
|
||||||
$wgCaptchaClass = 'FancyCaptcha';
|
$wgCaptchaClass = 'FancyCaptcha';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -56,20 +55,20 @@ $wgCaptchaSecret = "CHANGE_THIS_SECRET!";
|
||||||
*/
|
*/
|
||||||
$wgCaptchaDeleteOnSolve = false;
|
$wgCaptchaDeleteOnSolve = false;
|
||||||
|
|
||||||
$wgMessagesDirs['FancyCaptcha'] = __DIR__ . '/i18n/fancy';
|
$wgMessagesDirs['FancyCaptcha'] = __DIR__ . '/FancyCaptcha/i18n';
|
||||||
$wgExtensionMessagesFiles['FancyCaptcha'] = $dir . '/FancyCaptcha.i18n.php';
|
$wgExtensionMessagesFiles['FancyCaptcha'] = __DIR__ . '/FancyCaptcha.i18n.php';
|
||||||
$wgAutoloadClasses['FancyCaptcha'] = $dir . '/FancyCaptcha.class.php';
|
$wgAutoloadClasses['FancyCaptcha'] = __DIR__ . '/FancyCaptcha.class.php';
|
||||||
|
|
||||||
$wgResourceModules['ext.confirmEdit.fancyCaptcha.styles'] = array(
|
$wgResourceModules['ext.confirmEdit.fancyCaptcha.styles'] = array(
|
||||||
'position' => 'top',
|
'position' => 'top',
|
||||||
'localBasePath' => $dir . '/resources',
|
'localBasePath' => __DIR__ . '/resources',
|
||||||
'remoteExtPath' => 'ConfirmEdit/resources',
|
'remoteExtPath' => 'ConfirmEdit/resources',
|
||||||
'targets' => array( 'mobile', 'desktop' ),
|
'targets' => array( 'mobile', 'desktop' ),
|
||||||
'styles' => 'ext.confirmEdit.fancyCaptcha.css',
|
'styles' => 'ext.confirmEdit.fancyCaptcha.css',
|
||||||
);
|
);
|
||||||
|
|
||||||
$wgResourceModules['ext.confirmEdit.fancyCaptcha'] = array(
|
$wgResourceModules['ext.confirmEdit.fancyCaptcha'] = array(
|
||||||
'localBasePath' => $dir . '/resources',
|
'localBasePath' => __DIR__ . '/resources',
|
||||||
'remoteExtPath' => 'ConfirmEdit/resources',
|
'remoteExtPath' => 'ConfirmEdit/resources',
|
||||||
'scripts' => 'ext.confirmEdit.fancyCaptcha.js',
|
'scripts' => 'ext.confirmEdit.fancyCaptcha.js',
|
||||||
'dependencies' => 'mediawiki.api',
|
'dependencies' => 'mediawiki.api',
|
||||||
|
@ -78,12 +77,12 @@ $wgResourceModules['ext.confirmEdit.fancyCaptcha'] = array(
|
||||||
// FIXME: remove, add mobile target to ext.confirmEdit.fancyCaptcha and update
|
// FIXME: remove, add mobile target to ext.confirmEdit.fancyCaptcha and update
|
||||||
// MobileFrontend accordingly when bug 57629 is resolved
|
// MobileFrontend accordingly when bug 57629 is resolved
|
||||||
$wgResourceModules['ext.confirmEdit.fancyCaptchaMobile'] = array(
|
$wgResourceModules['ext.confirmEdit.fancyCaptchaMobile'] = array(
|
||||||
'localBasePath' => $dir . '/resources',
|
'localBasePath' => __DIR__ . '/resources',
|
||||||
'remoteExtPath' => 'ConfirmEdit/resources',
|
'remoteExtPath' => 'ConfirmEdit/resources',
|
||||||
'scripts' => 'ext.confirmEdit.fancyCaptcha.js',
|
'scripts' => 'ext.confirmEdit.fancyCaptcha.js',
|
||||||
'targets' => array( 'mobile', 'desktop' ),
|
'targets' => array( 'mobile', 'desktop' ),
|
||||||
'dependencies' => 'mobile.startup',
|
'dependencies' => 'mobile.startup',
|
||||||
);
|
);
|
||||||
|
|
||||||
$wgAutoloadClasses['ApiFancyCaptchaReload'] = $dir . '/ApiFancyCaptchaReload.php';
|
$wgAutoloadClasses['ApiFancyCaptchaReload'] = __DIR__ . '/ApiFancyCaptchaReload.php';
|
||||||
$wgAPIModules['fancycaptchareload'] = 'ApiFancyCaptchaReload';
|
$wgAPIModules['fancycaptchareload'] = 'ApiFancyCaptchaReload';
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue