feat(i18n): integrate i18next for internationalization support

- Added i18next and react-i18next for multi-language support in the application.
- Created localization files for English, Japanese, Korean, Traditional Chinese, and Simplified Chinese.
- Implemented translation hooks in various components to replace hardcoded strings with translatable keys.
- Updated ESLint configuration to include new i18n JSON validation rules.
- Introduced a new event bus for handling i18n updates during development.

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2025-06-12 17:56:11 +08:00
parent 4a385b9852
commit c775f82153
40 changed files with 1874 additions and 259 deletions

View File

@@ -1,6 +1,6 @@
---
description:
globs: src/core/**/*.ts
globs:
alwaysApply: false
---
# 存储抽象层

11
.cursor/rules/i18n.mdc Normal file
View File

@@ -0,0 +1,11 @@
---
description:
globs: locales/**/*.json
alwaysApply: false
---
i18n 编写规范。
1. 阅读并遵循 https://www.i18next.com/translation-function/formatting
2. 使用扁平键。使用 `.` 方式分割。不能使用 object 形式嵌套。
3. 对单复数敏感的语言应该区分,使用 `_one` 和 `_other` 的形式。
4. 在 build 阶段,扁平化的点分隔键(如 'exif.custom.rendered.custom')会自动转换为嵌套的 object 对象,因此可能引发冲突。例如,'exif.custom.rendered.custom' 会与 'exif.custom.rendered' 发生冲突。请避免使用此类点分隔的扁平键。