mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-12 09:09:25 +00:00
560f8642ed
Change-Id: I07a6abf0d85e4ec692bb25414d65c226977b69f7
26 lines
694 B
PHP
26 lines
694 B
PHP
<?php
|
|
/**
|
|
* VisualEditor i18n shim file to load the JSON equivalents.
|
|
*
|
|
* See https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format
|
|
*
|
|
* @file
|
|
*/
|
|
$messages = array();
|
|
array_map( function ( $dir ) use ( &$messages ) {
|
|
$files = glob( __DIR__ . "/$dir/*.json" );
|
|
foreach ( $files as $file ) {
|
|
$langcode = substr( basename( $file ), 0, -5 );
|
|
$data = json_decode( file_get_contents( $file ), /* $assoc = */ true );
|
|
unset( $data['@metadata'] );
|
|
$messages[$langcode] = isset( $messages[$langcode] ) ?
|
|
array_merge( $messages[$langcode], $data ) :
|
|
$data;
|
|
}
|
|
}, array(
|
|
'modules/oojs-ui/i18n',
|
|
'modules/ve/i18n',
|
|
'modules/ve-mw/i18n',
|
|
'modules/ve-wmf/i18n'
|
|
) );
|