<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Developer; use ModStart\Core\Util\SerializeUtil; class LangUtil { public static function extractFileLangScripts($ypGny) { goto zT2XH; MgUvQ: $vVYCS = file_get_contents($ypGny); goto v9zaW; zT2XH: $ypGny = base_path($ypGny); goto Mhh_E; PZCRO: return ''; goto z3uQ8; NPNV1: if (!empty($H_mB1[1])) { goto mbuNf; gJzUs: return '
{!! \\ModStart\\Developer\\LangUtil::langScriptPrepare(' . SerializeUtil::jsonEncodePretty(array_keys($GIlU4)) . ') !!}'; goto VgeD0; mbuNf: $GIlU4 = array(); goto eJINd; eJINd: foreach ($H_mB1[0] as $Esk0p) { if (preg_match('/^L\\([\'|"](.*?)[\'|"].*?\\)/', $Esk0p, $WgwvY)) { $GIlU4[$WgwvY[1]] = L($WgwvY[1]); } } goto IC3kW; IC3kW: ksort($GIlU4); goto gJzUs; VgeD0: } goto PZCRO; v9zaW: preg_match_all('/L\\((([^()]*|\\([^()]*\\))*)\\)/', $vVYCS, $H_mB1); goto NPNV1; Mhh_E: if (!file_exists($ypGny)) { return ''; } goto MgUvQ; z3uQ8: } public static function langScriptPrepare($GIlU4) { goto lpEI9; uEe4J: $p9E4n[] = '})();'; goto EmZUI; OEgdz: $p9E4n[] = '  window.lang = window.lang||{};'; goto jar5f; zpmgM: $p9E4n[] = '
(function(){'; goto OEgdz; EmZUI: return join('
', $p9E4n); goto RZP2b; jar5f: foreach ($GIlU4 as $U0Bxu) { $p9E4n[] = '  window.lang[' . SerializeUtil::jsonEncode($U0Bxu) . ']=' . SerializeUtil::jsonEncode(L($U0Bxu)) . ';'; } goto uEe4J; lpEI9: $p9E4n = array(); goto zpmgM; RZP2b: } }