From e6f3df7eaf6881a303358289dadb904824872d45 Mon Sep 17 00:00:00 2001 From: Eltrac Koalar Date: Wed, 7 Oct 2020 20:40:09 +0800 Subject: bring back the 1.x files to master --- libs/Language.php | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 libs/Language.php (limited to 'libs/Language.php') diff --git a/libs/Language.php b/libs/Language.php new file mode 100644 index 0000000..d24ae77 --- /dev/null +++ b/libs/Language.php @@ -0,0 +1,41 @@ +themeFile("lang/*.php")); + if(in_array($GLOBALS['miraclesLang'].'.php', $provided_lang)){ + require_once("lang/"+$GLOBALS['miraclesLang'].".php"); + $GLOBALS['miraclesLangError']=false; + }else{ + require_once("lang/zh-cn.php"); + $GLOBALS['miraclesLangError']=true; + } + } +} + +//快速获取对应语言文本 +function gt($a, $b) { + return $GLOBALS[$a][$b]; +} +function gtecho($a, $b) { + echo $GLOBALS[$a][$b]; +} +//有参数的文本获取 +function gta($a, $b, $c) { + $content = str_replace('%s', $c, $GLOBALS[$a][$b]); + return $content; +} +function gtaecho($a, $b, $c) { + $content = str_replace('%s', $c, $GLOBALS[$a][$b]); + echo $content; +} \ No newline at end of file -- cgit v1.2.3