mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 08:34:54 +00:00
728077039d
The shim triggers bug 58249, but that's not as bad as we thought. It turns out LocalisationUpdate still finishes despite the scary exception, it just skips VisualEditor and finishes the rest successfully. I will work on making the LU error more useful, and eventually making it support JSON blobs, but the shim isn't causing a lot of damage for now. Change-Id: I92f11524d891e901f1a089dd8cad1232478a5ee4
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'
|
|
) );
|