diff --git a/include/loader.php b/include/loader.php index fcd9010..55a1928 100644 --- a/include/loader.php +++ b/include/loader.php @@ -6,7 +6,14 @@ include(ROOT . "/include/data/config.php"); $Lang = new Lang(); $Option = new Option(); $result = $Option->getOption("Lang"); -$result = $result == "" ? "zh-CN" : $result; +if($result == "") { + $db = Config::MySQL(); + $conn = mysqli_connect($db['host'], $db['user'], $db['pass'], $db['name'], $db['port']); + mysqli_query($conn, "set names 'utf8mb4'"); + mysqli_query($conn, "INSERT INTO `option` VALUES ('4', 'Lang', 'zh_CN')"); + $result = "zh_CN"; + mysqli_close($conn); +} $Lang->setLang($result); class Loader {