From cc79d2d928e3b7ed8342ab70e677a921ccc57a05 Mon Sep 17 00:00:00 2001 From: TBXark Date: Fri, 20 Oct 2023 14:51:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20i18n=E5=88=9D=E5=A7=8B=E5=8C=96=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F=E9=94=99=E8=AF=AFBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/buildinfo.json | 2 +- dist/index.js | 6 +++--- dist/timestamp | 2 +- src/env.js | 5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/dist/buildinfo.json b/dist/buildinfo.json index 40567e20..735a9a5e 100644 --- a/dist/buildinfo.json +++ b/dist/buildinfo.json @@ -1 +1 @@ -{"sha": "d38184f", "timestamp": 1697784536} +{"sha": "50e577b", "timestamp": 1697784701} diff --git a/dist/index.js b/dist/index.js index f2c24e6f..3593caa4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -41,9 +41,9 @@ var Environment = class { // 检查更新的分支 UPDATE_BRANCH = "master"; // 当前版本 - BUILD_TIMESTAMP = 1697784536; + BUILD_TIMESTAMP = 1697784701; // 当前版本 commit id - BUILD_VERSION = "d38184f"; + BUILD_VERSION = "50e577b"; I18N = null; LANGUAGE = "zh-cn"; // 使用流模式 @@ -120,6 +120,7 @@ function initEnv(env, i18n2) { } } { + ENV.I18N = i18n2((ENV.LANGUAGE || "cn").toLowerCase()); if (env.TELEGRAM_TOKEN && !ENV.TELEGRAM_AVAILABLE_TOKENS.includes(env.TELEGRAM_TOKEN)) { if (env.BOT_NAME && ENV.TELEGRAM_AVAILABLE_TOKENS.length === ENV.TELEGRAM_BOT_NAME.length) { ENV.TELEGRAM_BOT_NAME.push(env.BOT_NAME); @@ -133,7 +134,6 @@ function initEnv(env, i18n2) { ENV.SYSTEM_INIT_MESSAGE = ENV.I18N?.env?.system_init_message || "You are a helpful assistant"; } } - ENV.I18N = i18n2((ENV.LANGUAGE || "cn").toLowerCase()); console.log(ENV); } diff --git a/dist/timestamp b/dist/timestamp index 509c1461..b31acd4d 100644 --- a/dist/timestamp +++ b/dist/timestamp @@ -1 +1 @@ -1697784536 +1697784701 diff --git a/src/env.js b/src/env.js index 98585580..e5c7a026 100644 --- a/src/env.js +++ b/src/env.js @@ -149,7 +149,9 @@ export function initEnv(env, i18n) { } } { - // 兼容性代码 兼容旧版本 + ENV.I18N = i18n((ENV.LANGUAGE || 'cn').toLowerCase()); + + // TELEGRAM_TOKEN 兼容旧版 if (env.TELEGRAM_TOKEN && !ENV.TELEGRAM_AVAILABLE_TOKENS.includes(env.TELEGRAM_TOKEN)) { if (env.BOT_NAME && ENV.TELEGRAM_AVAILABLE_TOKENS.length === ENV.TELEGRAM_BOT_NAME.length) { ENV.TELEGRAM_BOT_NAME.push(env.BOT_NAME); @@ -167,6 +169,5 @@ export function initEnv(env, i18n) { ENV.SYSTEM_INIT_MESSAGE = ENV.I18N?.env?.system_init_message || 'You are a helpful assistant'; } } - ENV.I18N = i18n((ENV.LANGUAGE || 'cn').toLowerCase()); console.log(ENV); }