2022-12-29 20:40:06 +01:00
|
|
|
<?php declare(strict_types=1);
|
2020-06-16 17:52:55 +02:00
|
|
|
|
|
|
|
use danog\MadelineProto\Lang;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Merge extracted docs.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
function mergeExtracted(): void
|
|
|
|
{
|
2022-12-08 20:16:40 +01:00
|
|
|
if (!file_exists('extracted.json')) {
|
2020-09-13 01:06:08 +02:00
|
|
|
return;
|
|
|
|
}
|
2022-12-08 20:16:40 +01:00
|
|
|
foreach (json_decode(file_get_contents('extracted.json'), true) as $key => $value) {
|
2023-07-08 17:41:40 +02:00
|
|
|
if ($key === 'method_messages.sendMultiMedia_param_multi_media_type_Vector<InputSingleMedia>') {
|
|
|
|
$value = 'The medias to send';
|
|
|
|
}
|
2022-12-08 20:16:40 +01:00
|
|
|
$key = preg_replace(['|flags\.\d+[?]|', '/Vector[<].*/'], ['', 'Vector t'], $key);
|
|
|
|
$key = str_replace('param_hash_type_int', 'param_hash_type_Vector t', $key);
|
2020-06-16 17:52:55 +02:00
|
|
|
Lang::$lang['en'][$key] = $value;
|
|
|
|
}
|
|
|
|
foreach (Lang::$lang['en'] as $key => $value) {
|
|
|
|
if ($value === '') {
|
|
|
|
unset(Lang::$lang['en'][$key]);
|
|
|
|
}
|
|
|
|
}
|
2022-12-08 20:16:40 +01:00
|
|
|
foreach (json_decode(file_get_contents('docs/template/disallow.json'), true) as $key => $value) {
|
2022-05-01 20:17:16 +02:00
|
|
|
Lang::$lang['en']["method_$key"] = $value;
|
2020-06-16 17:52:55 +02:00
|
|
|
}
|
|
|
|
}
|