mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-07-03 12:27:41 +08:00
chore(i18n): add i18next-cli extraction and lint tooling (#16220)
Signed-off-by: icarus <eurfelux@gmail.com>
This commit is contained in:
14
i18next.config.ts
Normal file
14
i18next.config.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { defineConfig } from 'i18next-cli'
|
||||
|
||||
export default defineConfig({
|
||||
locales: ['en-us', 'zh-cn'],
|
||||
extract: {
|
||||
input: ['src/renderer/**/*.{tsx,ts}'],
|
||||
ignore: ['src/renderer/**/__tests__/*.{tsx,ts}', 'src/renderer/**/*.test.{tsx,ts}'],
|
||||
output: 'src/renderer/i18n/locales/{{language}}.json',
|
||||
defaultNS: false,
|
||||
// 暂时不移除冗余键,等稳定下来后再清理
|
||||
removeUnusedKeys: false
|
||||
},
|
||||
lint: {}
|
||||
})
|
||||
@@ -36,6 +36,8 @@
|
||||
"typecheck:node": "tsgo --noEmit -p tsconfig.node.json --composite false",
|
||||
"typecheck:web": "tsgo --noEmit -p tsconfig.web.json --composite false",
|
||||
"i18n:check": "dotenv -e .env -- tsx scripts/check-i18n.ts",
|
||||
"i18n:extract": "i18next-cli extract",
|
||||
"i18n:lint": "i18next-cli lint",
|
||||
"i18n:hardcoded": "tsx scripts/check-hardcoded-strings.ts",
|
||||
"i18n:hardcoded:strict": "I18N_STRICT=true tsx scripts/check-hardcoded-strings.ts",
|
||||
"i18n:unused": "tsx scripts/check-unused-i18n.ts",
|
||||
@@ -342,6 +344,7 @@
|
||||
"html-to-text": "^9.0.5",
|
||||
"htmlparser2": "^10.0.0",
|
||||
"i18next": "^23.11.5",
|
||||
"i18next-cli": "^1.64.1",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"ignore": "^7.0.5",
|
||||
"ipaddr.js": "^2.2.0",
|
||||
|
||||
863
pnpm-lock.yaml
generated
863
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -24,6 +24,7 @@ overrides:
|
||||
tar-fs: '^2.1.4'
|
||||
undici: '6.23.0'
|
||||
vite: 'npm:rolldown-vite@7.3.0'
|
||||
yaml: '2.8.2'
|
||||
'@img/sharp-darwin-arm64': '0.34.5'
|
||||
'@img/sharp-darwin-x64': '0.34.5'
|
||||
'@img/sharp-linux-arm': '0.34.5'
|
||||
|
||||
Reference in New Issue
Block a user