feat(i18n): add i18next config and update extract commands

Add configuration file for i18next-cli with supported locales and extraction settings
Update package.json scripts to use i18next-cli commands for status and extraction
This commit is contained in:
icarus 2025-10-23 13:04:35 +08:00
parent 43fcfa6c95
commit 3677a34ceb
2 changed files with 15 additions and 1 deletions

13
i18next.config.ts Normal file
View File

@ -0,0 +1,13 @@
import { defineConfig } from 'i18next-cli';
export default defineConfig({
locales: [
"en-us",
"zh-cn",
"zh-tw"
],
extract: {
input: "src/renderer/src/**/*.{ts,tsx}",
output: "src/renderer/src/i18n/locales/{{language}}.json"
}
});

View File

@ -57,7 +57,8 @@
"i18n:check": "dotenv -e .env -- tsx scripts/check-i18n.ts",
"i18n:sync": "dotenv -e .env -- tsx scripts/sync-i18n.ts",
"i18n:auto": "dotenv -e .env -- tsx scripts/auto-translate-i18n.ts",
"i18n:scan": "i18next-scanner && yarn format",
"i18n:status": "i18next-cli status",
"i18n:extract": "i18next-cli extract",
"update:languages": "tsx scripts/update-languages.ts",
"test": "vitest run --silent",
"test:main": "vitest run --project main",