diff --git a/wwwroot/i18n/i18n_getmsgs.dspy b/wwwroot/i18n/i18n_getmsgs.dspy index f5a2c88b..68ad20cc 100644 --- a/wwwroot/i18n/i18n_getmsgs.dspy +++ b/wwwroot/i18n/i18n_getmsgs.dspy @@ -1,18 +1,14 @@ import json import os -def main(): - lang = params.get('lang', 'zh') - i18n_dir = os.path.join(os.path.dirname(__file__), 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) +lang = params.get('lang', 'zh') +i18n_dir = os.path.join(os.path.dirname(__file__), 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(msgs, ensure_ascii=False)