1
0
mirror of https://github.com/ZeroDream-CN/PHPMC7 synced 2024-11-24 13:15:10 +08:00
PHPMC7/include/core/PHPMC/Lang.php

22 lines
482 B
PHP
Raw Normal View History

<?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;
}
}