[PR #78] [CLOSED] Add i18n support #696

Closed
opened 2026-03-02 03:41:21 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/codexu/note-gen/pull/78
Author: @acelan
Created: 2/14/2025
Status: Closed

Base: devHead: i18n


📝 Commits (2)

  • f5c013a refactor: Replace hardcoded string with localization
  • b3f3b32 feat: update UI when language is changed

📊 Changes

59 files changed (+1047 additions, -374 deletions)

View changed files

📝 src/app/core/article/custom-toolbar/check.tsx (+4 -14)
📝 src/app/core/article/custom-toolbar/continue.tsx (+4 -8)
📝 src/app/core/article/custom-toolbar/eraser.tsx (+5 -4)
📝 src/app/core/article/custom-toolbar/history.tsx (+7 -6)
📝 src/app/core/article/custom-toolbar/mark.tsx (+8 -7)
📝 src/app/core/article/custom-toolbar/optimize.tsx (+5 -4)
📝 src/app/core/article/custom-toolbar/preview.tsx (+5 -4)
📝 src/app/core/article/custom-toolbar/question.tsx (+5 -4)
📝 src/app/core/article/custom-toolbar/redo.tsx (+3 -2)
📝 src/app/core/article/custom-toolbar/sync.tsx (+7 -11)
📝 src/app/core/article/custom-toolbar/toggle.tsx (+4 -2)
📝 src/app/core/article/custom-toolbar/translation.tsx (+6 -5)
📝 src/app/core/article/custom-toolbar/undo.tsx (+3 -2)
📝 src/app/core/article/file/file-item.tsx (+13 -12)
📝 src/app/core/article/file/file-toolbar.tsx (+6 -5)
📝 src/app/core/article/file/folder-item.tsx (+11 -10)
📝 src/app/core/article/md-editor.tsx (+4 -3)
📝 src/app/core/image/no-data.tsx (+6 -5)
📝 src/app/core/record/chat/chat-clipboard.tsx (+18 -17)
📝 src/app/core/record/chat/chat-content.tsx (+2 -1)

...and 39 more files

📄 Description

Extract most of the strings and build them into different locale files, en and zh_cn.
It'd be easier to add other language support.

There is one known issue.
In src/locale/index.tsx, the _t() will be called before loadLanguageFromStore() loads the correct currentLang on some pages. So, some string will still be the default lang which is 'en'.
Re-run the app loads and uses the correct language setting.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/codexu/note-gen/pull/78 **Author:** [@acelan](https://github.com/acelan) **Created:** 2/14/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `i18n` --- ### 📝 Commits (2) - [`f5c013a`](https://github.com/codexu/note-gen/commit/f5c013a8e96ec9066d4919c64adb0fc2983bb4f3) refactor: Replace hardcoded string with localization - [`b3f3b32`](https://github.com/codexu/note-gen/commit/b3f3b32b32f5b9db51cc2453ab57c65556e21b40) feat: update UI when language is changed ### 📊 Changes **59 files changed** (+1047 additions, -374 deletions) <details> <summary>View changed files</summary> 📝 `src/app/core/article/custom-toolbar/check.tsx` (+4 -14) 📝 `src/app/core/article/custom-toolbar/continue.tsx` (+4 -8) 📝 `src/app/core/article/custom-toolbar/eraser.tsx` (+5 -4) 📝 `src/app/core/article/custom-toolbar/history.tsx` (+7 -6) 📝 `src/app/core/article/custom-toolbar/mark.tsx` (+8 -7) 📝 `src/app/core/article/custom-toolbar/optimize.tsx` (+5 -4) 📝 `src/app/core/article/custom-toolbar/preview.tsx` (+5 -4) 📝 `src/app/core/article/custom-toolbar/question.tsx` (+5 -4) 📝 `src/app/core/article/custom-toolbar/redo.tsx` (+3 -2) 📝 `src/app/core/article/custom-toolbar/sync.tsx` (+7 -11) 📝 `src/app/core/article/custom-toolbar/toggle.tsx` (+4 -2) 📝 `src/app/core/article/custom-toolbar/translation.tsx` (+6 -5) 📝 `src/app/core/article/custom-toolbar/undo.tsx` (+3 -2) 📝 `src/app/core/article/file/file-item.tsx` (+13 -12) 📝 `src/app/core/article/file/file-toolbar.tsx` (+6 -5) 📝 `src/app/core/article/file/folder-item.tsx` (+11 -10) 📝 `src/app/core/article/md-editor.tsx` (+4 -3) 📝 `src/app/core/image/no-data.tsx` (+6 -5) 📝 `src/app/core/record/chat/chat-clipboard.tsx` (+18 -17) 📝 `src/app/core/record/chat/chat-content.tsx` (+2 -1) _...and 39 more files_ </details> ### 📄 Description Extract most of the strings and build them into different locale files, en and zh_cn. It'd be easier to add other language support. There is one known issue. In src/locale/index.tsx, the _t() will be called before loadLanguageFromStore() loads the correct currentLang on some pages. So, some string will still be the default lang which is 'en'. Re-run the app loads and uses the correct language setting. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 03:41:21 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/note-gen#696
No description provided.