2006-07-03 13:11:35 +00:00
|
|
|
<?php
|
2008-01-09 20:52:38 +00:00
|
|
|
$messages = array();
|
2014-03-26 09:06:27 +00:00
|
|
|
$GLOBALS['wgHooks']['LocalisationCacheRecache'][] = function ( $cache, $code, &$cachedData ) {
|
|
|
|
$codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] );
|
|
|
|
foreach ( $codeSequence as $csCode ) {
|
|
|
|
$fileName = __DIR__ . "/i18n/special/$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;
|
|
|
|
};
|