Files
mediawiki-extensions-Univer…/UniversalLanguageSelector.i18n.php
Amir E. Aharoni 1e18b6bd1a Move all the messages from i18n.php to json
This will require the import of all the translations from
the ext-universallanguageselector group
to the ext-jquery-uls group.

The messages already exists, so they are not re-imported.
In the next sync when the translatewiki config is updated,
the json message group of ULS will claim ownership of these messages.

Full export is needed to populate the messages in the existing json
files.

Change-Id: I6c5de42784971f59d1ca6b975095137a64c87363
2014-03-25 13:48:11 +02:00

21 lines
680 B
PHP

<?php
$messages = array();
$GLOBALS['wgHooks']['LocalisationCacheRecache'][] = function ( $cache, $code, &$cachedData ) {
$codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] );
foreach ( $codeSequence as $csCode ) {
$fileName = __DIR__ . "/i18n/$csCode.json";
if ( is_readable( $fileName ) ) {
$data = FormatJson::decode( file_get_contents( $fileName ), true );
foreach ( $data as $key => $unused ) {
if ( $key === '' || $key[0] === '@' ) {
unset( $data[$key] );
}
}
$cachedData['messages'] = array_merge( $data, $cachedData['messages'] );
}
$cachedData['deps'][] = new FileDependency( $fileName );
}
return true;
};