mirror of
https://github.com/ZeroDream-CN/PHPMC7
synced 2026-05-29 19:19:56 +08:00
增加多语言支持,修复 utf8mb4 乱码问题
更新版本到 7.3.3325
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
class Lang {
|
||||
|
||||
public $lang;
|
||||
public $data;
|
||||
|
||||
public function setLang($lang) {
|
||||
$this->lang = $lang;
|
||||
if(file_exists(ROOT . "/include/langs/{$lang}.php")) {
|
||||
include(ROOT . "/include/langs/{$lang}.php");
|
||||
$this->data = $langdata;
|
||||
} else {
|
||||
$this->data = Array();
|
||||
}
|
||||
}
|
||||
|
||||
public function str($text) {
|
||||
$data = $this->data;
|
||||
//file_put_contents(ROOT . "/lang.txt", "'{$text}' => '{$text}'", FILE_APPEND);
|
||||
return isset($data[$text]) ? $data[$text] : $text;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user