fix: 修复多语言获取
This commit is contained in:
@@ -492,6 +492,7 @@ class Admin extends AdminController
|
||||
$array = parse_ini_file($env, true);
|
||||
$array['LANG_DEFAULT_LANG'] = $language;
|
||||
$content = parse_array_ini($array);
|
||||
request()->session()->set('lang', $language);
|
||||
if (write_file($env, $content)) {
|
||||
return json(['success']);
|
||||
}
|
||||
|
||||
@@ -162,6 +162,9 @@
|
||||
admin.setStorage('language', obj.symbol);
|
||||
location.reload();
|
||||
})
|
||||
|
||||
// 清空本地缓存
|
||||
admin.setConfig("TabLists", undefined);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -558,8 +558,8 @@ if (!function_exists('__')) {
|
||||
*/
|
||||
function __($str, $parameters = [], $domain = null, $locale = null)
|
||||
{
|
||||
if (is_numeric($str)
|
||||
|| getenv('LANG_DEFAULT_LANG') === 'zh-CN') {
|
||||
$lang = session('lang', 'zh-CN');
|
||||
if (is_numeric($str) || strstr($lang, 'zh-CN')) {
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user