<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Developer; class LangUtil { public static function extractFileLangScripts($fWBvH) { goto E32fU; xAJZf: if (!file_exists($fWBvH)) { return ''; } goto iLeYh; WvzRA: preg_match_all('/L\\((([^()]*|\\([^()]*\\))*)\\)/', $ohNZt, $wsKBJ); goto PDA7z; E32fU: $fWBvH = base_path($fWBvH); goto xAJZf; iLeYh: $ohNZt = file_get_contents($fWBvH); goto WvzRA; PDA7z: if (!empty($wsKBJ[1])) { goto bKeT1; bKeT1: $Rk3iv = array(); goto vQqGH; BQPnB: ksort($Rk3iv); goto z1dD_; z1dD_: return '
{!! \\ModStart\\Developer\\LangUtil::langScriptPrepare(' . json_encode(array_keys($Rk3iv), JSON_PRETTY_PRINT) . ') !!}'; goto NnH2t; vQqGH: foreach ($wsKBJ[0] as $V563N) { if (preg_match('/^L\\([\'|"](.*?)[\'|"].*?\\)/', $V563N, $pcIb6)) { $Rk3iv[$pcIb6[1]] = L($pcIb6[1]); } } goto BQPnB; NnH2t: } goto fjTK6; fjTK6: return ''; goto IXUGq; IXUGq: } public static function langScriptPrepare($Rk3iv) { goto O8USZ; eS_PG: $ggdDa[] = '  window.lang = window.lang||{};'; goto GfVii; O8USZ: $ggdDa = array(); goto vqb3r; vqb3r: $ggdDa[] = '
(function(){'; goto eS_PG; GfVii: foreach ($Rk3iv as $Jdsmx) { $ggdDa[] = '  window.lang[' . json_encode($Jdsmx) . ']=' . json_encode(L($Jdsmx), JSON_UNESCAPED_UNICODE) . ';'; } goto bN7GR; bN7GR: $ggdDa[] = '})();'; goto BYJBq; BYJBq: return join('
', $ggdDa); goto RbmuR; RbmuR: } }