Added a complete yet concise i18n framework with support for four languages - #471
Open
TangYuanLonelyCat wants to merge 6 commits into
Open
Added a complete yet concise i18n framework with support for four languages#471TangYuanLonelyCat wants to merge 6 commits into
TangYuanLonelyCat wants to merge 6 commits into
Conversation
Added a basic i18n framework for this project. For startup speed and simplicity, no complex i18n dependencies are used. The current i18n.ts is just a demo and cannot be used in production.
* Key features implemented: - Refactored App.vue to use i18n for delete confirmation message and improved component structure - Enhanced BufferSelector.vue with i18n support for create new buffer text and improved UI - Modified EditBuffer.vue to use i18n for move to label and updated component logic - Updated NewBuffer.vue with i18n support for create in label and improved dialog title handling - Added i18n support to UpdateStatusItem.vue for all status messages and titles - Enhanced AddKeyBind.vue with i18n support for all dialog elements and labels - Updated KeyboardHotkey.vue with i18n support for all modifier key labels - Refactored Settings.vue to integrate i18n for all settings labels, titles, and options - Enhanced InputToggle.vue with i18n support for all search toggle tooltips - Created comprehensive English locale file (en.js) with all application text - Updated i18n.ts with robust locale detection and safe translation functions - Added complete Chinese locale file (zh.js) with corresponding translations - Integrated i18n plugin into main.js for global locale management - Updated editor cache store with refined comment language and improved code clarity - Enhanced Heynote store with i18n-ready buffer title handling and improved tab management The changes provide full internationalization support while maintaining all existing functionality and improving code maintainability through consistent English comments. Signed-off-by: 孤独の汤圆猫猫 <lemon121410@163.com> --------- Signed-off-by: 孤独の汤圆猫猫 <lemon121410@163.com>
… the i18n module is imported – i18n framework update – Support for Chinese, Japanese, English, and Korean. Changed the original import using @ to the relative path import commonly used by heyman, fixing the import failure issue. Updated the i18n framework; the current i18n framework is more stable. Added support for four languages: Chinese, Japanese, English, and Korean. Translation support comes from Doubao AI, a subsidiary of China's ByteDance.
…documentation (keyboard shortcut hints) Added four-language translations for the command palette and initial documentation (keyboard shortcut hints), resolving the hardcoded strings in the original system and fixing the return key/value issue left over from the previous update. All tests are currently working normally.
TangYuanLonelyCat
marked this pull request as draft
April 10, 2026 16:20
TangYuanLonelyCat
marked this pull request as ready for review
April 10, 2026 16:20
Author
|
Oh, by the way, I might have forgotten to mention that the initial hint document is generated based on the user's system language, not just English. |
- Added toggleLeftPanel function and command with i18n support
- Added translations for toggleLeftPanel in all language files
- Fixed syntax errors in en.js and zh.js language files
This update ensures compatibility with the latest main branch while maintaining full i18n support for all languages.
TangYuanLonelyCat
marked this pull request as draft
April 19, 2026 11:45
Signed-off-by: 孤独の汤圆猫猫 <lemon121410@163.com>
TangYuanLonelyCat
marked this pull request as ready for review
April 19, 2026 11:50
Author
|
OK, I've resolved this conflict, and it can now be merged cleanly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preface
Why did I do this?
Because I like the Heynote project, but when I recommend it to my friends, they often say: "This software is great, too bad there's no Chinese localization." Out of my deep agreement with the project's philosophy, I added an i18n framework and submitted a PR. I sincerely hope this PR can be merged into the main branch – I believe many users will need it.
About using AI assistance
Yes, this PR was generated with AI assistance, specifically in the following areas:
Note: The core i18n framework in this PR was created by myself.
Files modified by these changes
1. New i18n core files
1.1
src/locales/i18n-core.tsLocaletype, supporting'en','zh','ja','ko', and'zh-TW'(Traditional Chinese, as a variant of Simplified Chinese, counted under the same language)messagesobject to store all language datasafeTranslatefunction, providing safe translation with language fallback and parameter interpolation1.2
src/locales/i18n.ts./i18n-corecreateI18nfunction to create an i18n instance1.3 Language files
src/locales/en.js: English language file – includes translations for UI, commands, initial content, and keyboard shortcutssrc/locales/zh.js: Simplified Chinese language file – includes translations for UI, commands, initial content, and keyboard shortcutssrc/locales/ja.js: Japanese language file – includes translations for UI, commands, initial content, and keyboard shortcutssrc/locales/ko.js: Korean language file – includes translations for UI, commands, initial content, and keyboard shortcutssrc/locales/zh-TW.js: Traditional Chinese language file – as a variant of Simplified Chinese, it is considered under the same language support. Provides Traditional Chinese translations based on the Simplified Chinese version.2. Modified application files to support i18n
2.1
electron/initial-content.tssafeTranslatefrom../src/locales/i18n-coresafeTranslatefunction to translate the initial hint document content2.2
shared-utils/key-helper.tssafeTranslatefrom../src/locales/i18n-coregetSystemLocalefunction to get the current languagekeyHelpStrfunction to usesafeTranslatefor translating shortcut hints2.3
src/editor/commands.jsi18nfrom../locales/i18ni18n.t()for translating command names2.4 Component files
src/components/BufferSelector.vue: Importi18n, translate UI elementssrc/components/settings/Settings.vue: Importi18n, translate settings UIsrc/components/UpdateStatusItem.vue: Importi18n, translate update statussrc/components/EditBuffer.vue: Importi18n, translate editing UIsrc/components/App.vue: Importi18n, translate application UIsrc/components/NewBuffer.vue: Importi18n, translate new buffer UIsrc/editor/search/InputToggle.vue: Importi18n, translate search UIFinal results
3.1 Language detection
3.2 Translation system
i18n-core.tsi18n.ts3.3 Multilingual support
safeTranslatefunction to retrieve translations4. Error handling and compatibility
Summary
All modifications have been tested to ensure the stability and reliability of the i18n framework.
By TangYuanLonelyCat
This document was summarized by myself and translated by DeepSeek. It has been confirmed that all m
eanings are conveyed accurately.