MadelineProto/tools/merge.php
2019-12-27 17:43:29 +01:00

17 lines
484 B
PHP

<?php
require 'vendor/autoload.php';
use danog\MadelineProto\DocsBuilder;
use danog\MadelineProto\Lang;
foreach (\json_decode(\file_get_contents('extracted.json'), true) as $key => $value) {
$key = \preg_replace(['|flags\.\d+[?]|', '|[<]|', '|[>]|'], ['', ' ', ''], $key);
Lang::$lang['en'][$key] = $value;
}
foreach (Lang::$lang['en'] as $key => $value) {
if ($value === '') {
unset(Lang::$lang['en'][$key]);
}
}
DocsBuilder::addToLang($key, $value, true);