diff --git a/init.php b/init.php index d3da03d..0a875ba 100644 --- a/init.php +++ b/init.php @@ -136,6 +136,11 @@ if (!empty($_SESSION['user_language'])) { $config['language'] = $_SESSION['user_language']; }else if (!empty($_COOKIE['user_language'])) { $config['language'] = $_COOKIE['user_language']; +}else if(User::getID()>0){ + $lang = User::getAttribute("Language"); + if(!empty($lang)){ + $config['language'] = $lang; + } } if (empty($_SESSION['Lang'])) { diff --git a/system/controllers/accounts.php b/system/controllers/accounts.php index 4fb44e3..5a1e472 100644 --- a/system/controllers/accounts.php +++ b/system/controllers/accounts.php @@ -328,7 +328,7 @@ switch ($action) { $_SESSION['Lang'] = $_L; file_put_contents($lan_file, json_encode($_L)); } - + User::setAttribute("Language", $selected_language); r2($_SERVER['HTTP_REFERER'], 's', ucwords($selected_language));