mirror of
https://github.com/ZeroDream-CN/PHPMC7
synced 2024-11-25 05:32:53 +08:00
22 lines
482 B
PHP
22 lines
482 B
PHP
|
<?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;
|
||
|
}
|
||
|
}
|