* in the core.
*
* Since MediaWiki 1.23, use of this variable to define messages is discouraged; instead, store
- * messages in JSON format and use $wgExtensionMessagesDirs. For setting other variables than
+ * messages in JSON format and use $wgMessagesDirs. For setting other variables than
* $messages, $wgExtensionMessagesFiles should still be used.
*
- * If there is an entry in $wgExtensionMessagesDirs with the same key as one in
+ * If there is an entry in $wgMessagesDirs with the same key as one in
* $wgExtensionMessagesFiles, then any $messages variables set in the $wgExtensionMessagesFiles file
* will be ignored. This means an extension that only provides messages can be backwards compatible
- * by using both $wgExtensionMessagesFiles and $wgExtensionMessagesDirs, and only one of the two
+ * by using both $wgExtensionMessagesFiles and $wgMessagesDirs, and only one of the two
* will be used depending on what the version of MediaWiki supports.
*
* @par Example:
*
* @par Simple example:
* @code
- * $wgExtensionMessagesDirs['ConfirmEdit'] = __DIR__ . '/i18n';
+ * $wgMessagesDirs['ConfirmEdit'] = __DIR__ . '/i18n';
* @endcode
*
* @par Complex example:
* @code
- * $wgExtensionMessagesDirs['VisualEditor'] = array(
+ * $wgMessagesDirs['VisualEditor'] = array(
* __DIR__ . '/i18n',
* __DIR__ . '/modules/ve-core/i18n',
* __DIR__ . '/modules/qunit/localisation',
* @endcode
* @since 1.23
*/
-$wgExtensionMessagesDirs = array();
+$wgMessagesDirs = array();
/**
* Array of files with list(s) of extension entry points to be used in
* @throws MWException
*/
public function recache( $code ) {
- global $wgExtensionMessagesFiles, $wgExtensionMessagesDirs;
+ global $wgExtensionMessagesFiles, $wgMessagesDirs;
wfProfileIn( __METHOD__ );
if ( !$code ) {
# like site-specific message overrides.
wfProfileIn( __METHOD__ . '-extensions' );
$allData = $initialData;
- foreach ( $wgExtensionMessagesDirs as $dirs ) {
+ foreach ( $wgMessagesDirs as $dirs ) {
foreach ( (array)$dirs as $dir ) {
foreach ( $codeSequence as $csCode ) {
$fileName = "$dir/$csCode.json";
$used = false;
foreach ( $data as $key => $item ) {
- if ( $key === 'messages' && isset( $wgExtensionMessagesDirs[$extension] ) ) {
+ if ( $key === 'messages' && isset( $wgMessagesDirs[$extension] ) ) {
# For backwards compatibility, ignore messages from extensions in
- # $wgExtensionMessagesFiles that are also present in $wgExtensionMessagesDirs.
+ # $wgExtensionMessagesFiles that are also present in $wgMessagesDirs.
# This allows extensions to use both and be backwards compatible.
# Variables other than $messages still need to be supported though.
continue;
# Add cache dependencies for any referenced globals
$deps['wgExtensionMessagesFiles'] = new GlobalDependency( 'wgExtensionMessagesFiles' );
- $deps['wgExtensionMessagesDirs'] = new GlobalDependency( 'wgExtensionMessagesDirs' );
+ $deps['wgMessagesDirs'] = new GlobalDependency( 'wgMessagesDirs' );
$deps['version'] = new ConstantDependency( 'MW_LC_VERSION' );
# Add dependencies to the cache entry
$this->addOption( 'list-file', 'A file containing a list of extension setup files, one per line.', false, true );
$this->addOption( 'extensions-dir', 'Path where extensions can be found.', false, true );
$this->addOption( 'output', 'Send output to this file (omit for stdout)', false, true );
- $this->mDescription = 'Merge $wgExtensionMessagesFiles and $wgExtensionMessagesDirs from ' .
+ $this->mDescription = 'Merge $wgExtensionMessagesFiles and $wgMessagesDirs from ' .
' various extensions to produce a single file listing all message files and dirs.';
}
"## This file is generated by mergeMessageFileList.php. Do not edit it directly.\n\n" .
"if ( defined( 'MW_NO_EXTENSION_MESSAGES' ) ) return;\n\n" .
'$wgExtensionMessagesFiles = ' . var_export( $wgExtensionMessagesFiles, true ) . ";\n\n" .
- '$wgExtensionMessagesDirs = ' . var_export( $wgExtensionMessagesDirs, true ) . ";\n\n";
+ '$wgMessagesDirs = ' . var_export( $wgMessagesDirs, true ) . ";\n\n";
$dirs = array(
$IP,