Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/translation-glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,20 @@ This document provides standard translation references for key terminology in th
| 代理 | Proxy | 代理服务器地址 | Proxy server address |
| 模型重定向 | Model Mapping | 请求体中模型名称替换 | Model name replacement in request body |

## 安全相关 (Security Related)

| 中文 | English | 说明 | Description |
|------|---------|------|-------------|
| 两步验证 | Two-Factor Authentication | 为账户提供额外安全保护的验证方式 | Additional security verification method for accounts |
| 2FA | Two-Factor Authentication | 两步验证的缩写 | Abbreviation for Two-Factor Authentication |

## 计费相关 (Billing Related)

| 中文 | English | 说明 | Description |
|------|---------|------|-------------|
| 倍率 | Ratio | 价格计算的乘数因子 | Multiplier factor used for price calculation |
| 倍率 | Multiplier | 价格计算的乘数因子(同义词) | Multiplier factor used for price calculation (synonym) |

## 翻译注意事项 (Translation Guidelines)

- **提示 (Prompt)** = 模型输入内容 / Model input content
Expand Down
94 changes: 94 additions & 0 deletions web/i18next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/*
Copyright (C) 2025 QuantumNous

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.

For commercial licensing, please contact support@quantumnous.com
*/

import { defineConfig } from 'i18next-cli';

/** @type {import('i18next-cli').I18nextToolkitConfig} */
export default defineConfig({
locales: [
"zh",
"en",
"fr"
],
extract: {
input: [
"src/**/*.{js,jsx,ts,tsx}"
],
ignore: [
"src/i18n/**/*"
],
output: "src/i18n/locales/{{language}}.json",
ignoredAttributes: [
"accept",
"align",
"aria-label",
"autoComplete",
"className",
"clipRule",
"color",
"crossOrigin",
"data-index",
"data-name",
"data-testid",
"data-type",
"defaultActiveKey",
"direction",
"editorType",
"field",
"fill",
"fillRule",
"height",
"hoverStyle",
"htmlType",
"id",
"itemKey",
"key",
"keyPrefix",
"layout",
"margin",
"maxHeight",
"mode",
"name",
"overflow",
"placement",
"position",
"rel",
"role",
"rowKey",
"searchPosition",
"selectedStyle",
"shape",
"size",
"style",
"theme",
"trigger",
"uploadTrigger",
"validateStatus",
"value",
"viewBox",
"width"
],
Comment thread
Sacode marked this conversation as resolved.
Resolved
sort: true,
disablePlurals: false,
removeUnusedKeys: true,
nsSeparator: false,
keySeparator: false,
mergeNamespaces: true
}
});
9 changes: 7 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@
"lint:fix": "prettier . --write",
"eslint": "bunx eslint \"**/*.{js,jsx}\" --cache",
"eslint:fix": "bunx eslint \"**/*.{js,jsx}\" --fix --cache",
"preview": "vite preview"
"preview": "vite preview",
"i18n:extract": "bunx i18next-cli extract",
"i18n:status": "bunx i18next-cli status",
"i18n:sync": "bunx i18next-cli sync",
"i18n:lint": "bunx i18next-cli lint"
},
"eslintConfig": {
"extends": [
Expand Down Expand Up @@ -81,7 +85,8 @@
"prettier": "^3.0.0",
"tailwindcss": "^3",
"typescript": "4.4.2",
"vite": "^5.2.0"
"vite": "^5.2.0",
"i18next-cli": "^1.10.3"
},
"prettier": {
"singleQuote": true,
Expand Down
12 changes: 3 additions & 9 deletions web/src/i18n/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,9 @@ i18n
.init({
load: 'languageOnly',
resources: {
en: {
translation: enTranslation,
},
zh: {
translation: zhTranslation,
},
fr: {
translation: frTranslation,
},
en: enTranslation,
zh: zhTranslation,
fr: frTranslation,
},
fallbackLng: 'zh',
interpolation: {
Expand Down
Loading