. * * @author Daniil Gentili * @copyright 2016-2023 Daniil Gentili * @license https://opensource.org/licenses/AGPL-3.0 AGPLv3 * @link https://docs.madelineproto.xyz MadelineProto documentation */ namespace danog\MadelineProto; /** @internal */ final class Lang { public static array $lang = %s; // THIS WILL BE OVERWRITTEN BY $lang["en"] public static array $current_lang = %s; }'; $base = json_decode(file_get_contents("langs/en.json"), true); $langs = []; foreach (glob("langs/*.json") as $lang) { $code = basename($lang, '.json'); $langs[$code] = array_merge($base, json_decode(file_get_contents($lang), true)); ksort($langs[$code]); } file_put_contents('src/Lang.php', sprintf($template, var_export($langs, true), var_export($langs['en'], true)));