14 $dir = self::getDirectory();
19 $fileName =
"$dir/" . self::getFilename( $code );
20 if ( is_readable( $fileName ) ) {
21 $data = FormatJson::decode( file_get_contents( $fileName ),
true );
22 $cache[
'messages'] = array_merge(
$cache[
'messages'], $data );
33 $dir = self::getDirectory();
38 $codeSequence = array_merge( [ $code ],
$cache[
'fallbackSequence'] );
39 foreach ( $codeSequence as $csCode ) {
40 $fileName =
"$dir/" . self::getFilename( $csCode );
65 return "l10nupdate-$language.json";
$wgCacheDirectory
Directory for caching data in the local filesystem.
Class for caching the contents of localisation files, Messages*.php and *.i18n.php.
static getDirectory()
Returns a directory where updated translations are stored.
static onRecache(LocalisationCache $lc, $code, array &$cache)
Hook: LocalisationCacheRecache.
static onRecacheFallback(LocalisationCache $lc, $code, array &$cache)
Hook: LocalisationCacheRecacheFallback.
static getFilename( $language)
Returns a filename where updated translations are stored.