mirror of
https://github.com/HiMeditator/auto-caption.git
synced 2026-02-21 17:04:42 +08:00
feat(i18n): 后端添加国际化支持、优化前端界面
- 后端添加并实现国际化支持 - 前端引入 vue-i18n 模块(尚未添加国际化逻辑) - 优化用户界面样式,统一输入框和标签样式
This commit is contained in:
11
src/main/i18n/index.ts
Normal file
11
src/main/i18n/index.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import zh from './lang/zh'
|
||||
import en from './lang/en'
|
||||
import ja from './lang/ja'
|
||||
import { allConfig } from '../utils/AllConfig'
|
||||
|
||||
export function i18n(key: string): string{
|
||||
if(allConfig.uiLanguage === 'zh') return zh[key] || key
|
||||
else if(allConfig.uiLanguage === 'en') return en[key] || key
|
||||
else if(allConfig.uiLanguage === 'ja') return ja[key] || key
|
||||
else return key
|
||||
}
|
||||
8
src/main/i18n/lang/en.ts
Normal file
8
src/main/i18n/lang/en.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export default {
|
||||
"gummy.env.missing": "DASHSCOPE_API_KEY environment variable not detected. To use the gummy engine, you need to obtain an API Key from Alibaba Cloud's Bailian platform and add it to your local environment variables.",
|
||||
"platform.unsupported": "Unsupported platform: ",
|
||||
"engine.start.error": "Caption engine failed to start: ",
|
||||
"engine.output.parse.error": "Unable to parse caption engine output as a JSON object: ",
|
||||
"engine.error": "Caption engine error: ",
|
||||
"engine.shutdown.error": "Failed to shut down the caption engine process: "
|
||||
}
|
||||
8
src/main/i18n/lang/ja.ts
Normal file
8
src/main/i18n/lang/ja.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export default {
|
||||
"gummy.env.missing": "DASHSCOPE_API_KEY 環境変数が検出されませんでした。Gummy エンジンを使用するには、Alibaba Cloud の百煉プラットフォームから API Key を取得し、ローカル環境変数に追加する必要があります。",
|
||||
"platform.unsupported": "サポートされていないプラットフォーム: ",
|
||||
"engine.start.error": "字幕エンジンの起動に失敗しました: ",
|
||||
"engine.output.parse.error": "字幕エンジンの出力を JSON オブジェクトとして解析できませんでした: ",
|
||||
"engine.error": "字幕エンジンエラー: ",
|
||||
"engine.shutdown.error": "字幕エンジンプロセスの終了に失敗しました: "
|
||||
}
|
||||
8
src/main/i18n/lang/zh.ts
Normal file
8
src/main/i18n/lang/zh.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export default {
|
||||
"gummy.env.missing": "没有检测到 DASHSCOPE_API_KEY 环境变量,如果要使用 gummy 引擎,需要在阿里云百炼平台获取 API Key 并添加到本机环境变量",
|
||||
"platform.unsupported": "不支持的平台:",
|
||||
"engine.start.error": "字幕引擎启动失败:",
|
||||
"engine.output.parse.error": "字幕引擎输出内容无法解析为 JSON 对象:",
|
||||
"engine.error": "字幕引擎错误:",
|
||||
"engine.shutdown.error": "字幕引擎进程关闭失败:"
|
||||
}
|
||||
Reference in New Issue
Block a user