mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 14:56:20 +00:00
9abad0385d
For performance we might also want to provide a conversion script that generates a static PHP file. Change-Id: I6a72bb3ec23c90fc5740327a7e46b4d805562779
19 lines
531 B
PHP
19 lines
531 B
PHP
<?php
|
|
$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'
|
|
) );
|