接口提示信息国际化

This commit is contained in:
whyour
2026-06-11 02:19:04 +08:00
parent 946731ac8d
commit 05f8fd3805
17 changed files with 206 additions and 26 deletions
+12
View File
@@ -19,6 +19,7 @@ import { shareStore } from '../shared/store';
import Logger from './logger';
import { AppModel } from '../data/open';
import { InstanceStatus, RunningInstanceModel } from '../data/runningInstance';
import { setLang } from '../shared/i18n';
export default async () => {
const cronService = Container.get(CronService);
@@ -224,6 +225,17 @@ export default async () => {
// 初始化保存一次ck和定时任务数据
await cronService.autosave_crontab();
// 确保 lang_env.sh 存在,提供默认 QL_LANG
try {
const langEnvExist = await fileExist(config.langEnvFile);
if (!langEnvExist) {
const lang = systemConfig.info?.lang || 'zh';
await writeFile(config.langEnvFile, `export QL_LANG='${lang}'\n`);
}
} catch {}
setLang(systemConfig.info?.lang || 'zh');
await envService.set_envs();
const authInfo = await userService.getAuthInfo();