mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-07 13:59:28 +08:00
feat(i18n): enhance i18next configuration and vscode settings
- Add new i18next config options including defaultValue, primaryLanguage, and types generation - Update vscode settings for better i18n-ally integration and namespace support - Reorder search exclude patterns for consistency
This commit is contained in:
parent
cf0aa49427
commit
3e990dddb5
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
@ -35,19 +35,20 @@
|
|||||||
".oxlintrc.json": "jsonc"
|
".oxlintrc.json": "jsonc"
|
||||||
},
|
},
|
||||||
"files.eol": "\n",
|
"files.eol": "\n",
|
||||||
|
"i18n-ally.defaultNamespace": "translation",
|
||||||
// "i18n-ally.displayLanguage": "zh-cn", // 界面显示语言
|
// "i18n-ally.displayLanguage": "zh-cn", // 界面显示语言
|
||||||
"i18n-ally.enabledFrameworks": ["react-i18next", "i18next"],
|
"i18n-ally.enabledFrameworks": ["react-i18next", "i18next"],
|
||||||
"i18n-ally.enabledParsers": ["ts", "js", "json"], // 解析语言
|
"i18n-ally.enabledParsers": ["ts", "js", "json"], // 解析语言
|
||||||
"i18n-ally.fullReloadOnChanged": true,
|
"i18n-ally.fullReloadOnChanged": true,
|
||||||
"i18n-ally.keystyle": "nested", // 翻译路径格式
|
"i18n-ally.keystyle": "nested", // 翻译路径格式
|
||||||
"i18n-ally.localesPaths": ["src/renderer/src/i18n/locales"],
|
"i18n-ally.localesPaths": ["src/renderer/src/i18n/locales"],
|
||||||
// "i18n-ally.namespace": true, // 开启命名空间
|
"i18n-ally.namespace": true, // 开启命名空间
|
||||||
"i18n-ally.sortKeys": true, // 排序
|
"i18n-ally.sortKeys": true, // 排序
|
||||||
"i18n-ally.sourceLanguage": "zh-cn", // 翻译源语言
|
"i18n-ally.sourceLanguage": "zh-cn", // 翻译源语言
|
||||||
"i18n-ally.usage.derivedKeyRules": ["{key}_one", "{key}_other"], // 标记单复数形式的键为已翻译
|
"i18n-ally.usage.derivedKeyRules": ["{key}_one", "{key}_other"], // 标记单复数形式的键为已翻译
|
||||||
"search.exclude": {
|
"search.exclude": {
|
||||||
"**/dist/**": true,
|
".yarn/releases/**": true,
|
||||||
".yarn/releases/**": true
|
"**/dist/**": true
|
||||||
},
|
},
|
||||||
"tailwindCSS.classAttributes": [
|
"tailwindCSS.classAttributes": [
|
||||||
"className",
|
"className",
|
||||||
|
|||||||
@ -1,9 +1,19 @@
|
|||||||
import { defineConfig } from 'i18next-cli'
|
import { defineConfig } from 'i18next-cli'
|
||||||
|
|
||||||
|
/** @see https://github.com/i18next/i18next-cli */
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
locales: ['en-us', 'zh-cn', 'zh-tw'],
|
locales: ['en-us', 'zh-cn', 'zh-tw'],
|
||||||
extract: {
|
extract: {
|
||||||
input: 'src/renderer/src/**/*.{ts,tsx}',
|
input: 'src/renderer/src/**/*.{ts,tsx}',
|
||||||
output: 'src/renderer/src/i18n/locales/{{language}}.json'
|
output: 'src/renderer/src/i18n/locales/{{language}}.json',
|
||||||
|
defaultValue: '__MISSING_KEY__',
|
||||||
|
primaryLanguage: 'en-us',
|
||||||
|
removeUnusedKeys: false
|
||||||
|
},
|
||||||
|
types: {
|
||||||
|
input: ['src/renderer/src/i18n/locales/en-us.json'],
|
||||||
|
output: 'src/renderer/src/i18n/i18next.d.ts',
|
||||||
|
resourcesFile: 'src/renderer/src/i18n/resources.d.ts',
|
||||||
|
enableSelector: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user