From d3befb972d3dc35a75ba5dc21eb00cacc4efe5e5 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 25 Jun 2026 14:03:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20i18n=5Fgetmsgs=20?= =?UTF-8?q?=E7=AB=AF=E7=82=B9=E6=94=AF=E6=8C=81=E5=A4=9A=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/i18n_getmsgs.dspy | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 wwwroot/i18n_getmsgs.dspy diff --git a/wwwroot/i18n_getmsgs.dspy b/wwwroot/i18n_getmsgs.dspy new file mode 100644 index 00000000..5c67ff80 --- /dev/null +++ b/wwwroot/i18n_getmsgs.dspy @@ -0,0 +1,18 @@ +import json +import os + +def main(): + lang = params.get('lang', 'zh') + i18n_dir = os.path.join(os.path.dirname(__file__), 'i18n', lang) + i18n_file = os.path.join(i18n_dir, 'i18n.json') + + if os.path.exists(i18n_file): + with open(i18n_file, 'r', encoding='utf-8') as f: + msgs = json.load(f) + else: + msgs = {} + + return json.dumps({ + "success": True, + "msgs": msgs + }, ensure_ascii=False)