-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add Chinese (zh) language support #2009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
4a2aa9f
8e38137
9255dee
c263e17
e8fef4b
a700485
28dca17
f7e6a6c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,19 @@ import frTaskReview from './locales/fr/taskReview.json'; | |
| import frTerminal from './locales/fr/terminal.json'; | ||
| import frErrors from './locales/fr/errors.json'; | ||
|
|
||
| // Import Chinese translation resources | ||
| import zhCommon from './locales/zh/common.json'; | ||
| import zhNavigation from './locales/zh/navigation.json'; | ||
| import zhSettings from './locales/zh/settings.json'; | ||
| import zhTasks from './locales/zh/tasks.json'; | ||
| import zhWelcome from './locales/zh/welcome.json'; | ||
| import zhOnboarding from './locales/zh/onboarding.json'; | ||
| import zhDialogs from './locales/zh/dialogs.json'; | ||
| import zhGitlab from './locales/zh/gitlab.json'; | ||
| import zhTaskReview from './locales/zh/taskReview.json'; | ||
| import zhTerminal from './locales/zh/terminal.json'; | ||
| import zhErrors from './locales/zh/errors.json'; | ||
|
|
||
| export const defaultNS = 'common'; | ||
|
|
||
| export const resources = { | ||
|
|
@@ -55,6 +68,19 @@ export const resources = { | |
| taskReview: frTaskReview, | ||
| terminal: frTerminal, | ||
| errors: frErrors | ||
| }, | ||
| zh: { | ||
| common: zhCommon, | ||
| navigation: zhNavigation, | ||
| settings: zhSettings, | ||
| tasks: zhTasks, | ||
| welcome: zhWelcome, | ||
| onboarding: zhOnboarding, | ||
| dialogs: zhDialogs, | ||
| gitlab: zhGitlab, | ||
| taskReview: zhTaskReview, | ||
| terminal: zhTerminal, | ||
| errors: zhErrors | ||
| } | ||
|
Comment on lines
+74
to
84
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: The new Chinese ( Suggested FixUpdate Prompt for AI AgentDid we get this right? 👍 / 👎 to inform future reviews. |
||
| } as const; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: AndyMik90/Aperant
Length of output: 2193
🏁 Script executed:
# Check the current state of spellcheck.ts cat -n apps/desktop/src/shared/constants/spellcheck.tsRepository: AndyMik90/Aperant
Length of output: 1244
🏁 Script executed:
Repository: AndyMik90/Aperant
Length of output: 1137
🏁 Script executed:
Repository: AndyMik90/Aperant
Length of output: 1357
🏁 Script executed:
Repository: AndyMik90/Aperant
Length of output: 9206
🏁 Script executed:
Repository: AndyMik90/Aperant
Length of output: 2872
🏁 Script executed:
Repository: AndyMik90/Aperant
Length of output: 212
🏁 Script executed:
Repository: AndyMik90/Aperant
Length of output: 250
🏁 Script executed:
Repository: AndyMik90/Aperant
Length of output: 2194
🌐 Web query:
Electron 40.0 Chromium spell checker available languages zh-CN zh-TW Chinese support💡 Result:
In Electron 40.0.0 (based on Chromium 144.0.7559.60), the built-in spell checker supports Chinese (Simplified, zh-CN) and Chinese (Traditional, zh-TW) on Windows and Linux via Chromium's Hunspell dictionaries. These languages are part of Chromium's supported spellcheck languages, as Chromium's Hunspell dictionaries include support for numerous languages including zh-CN and zh-TW (evidenced by Chromium's deps/hunspell_dictionaries repo listing extensive language support and Chromium's general multilingual spellcheck capabilities). On macOS, it uses native APIs which automatically detect languages, including Chinese variants. To check available languages in code: webContents.session.availableSpellCheckerLanguages. To set: session.setSpellCheckerLanguages(['zh-CN', 'zh-TW']). Dictionaries are downloaded from Google's CDN by default.
Citations:
🏁 Script executed:
Repository: AndyMik90/Aperant
Length of output: 43
Add Chinese spell check mappings to complete language support.
Adding 'zh' to
SupportedLanguageandAVAILABLE_LANGUAGESinapps/desktop/src/shared/constants/i18n.tswithout corresponding entries inSPELL_CHECK_LANGUAGE_MAPandADD_TO_DICTIONARY_LABELSinapps/desktop/src/shared/constants/spellcheck.tsleaves the feature incomplete.When Chinese is selected:
SPELL_CHECK_LANGUAGE_MAP[language] || [DEFAULT_SPELL_CHECK_LANGUAGE]fallback inapps/desktop/src/main/ipc-handlers/settings-handlers.ts:858)ADD_TO_DICTIONARY_LABELS[getAppLanguage()] || ADD_TO_DICTIONARY_LABELS['en']fallback inapps/desktop/src/main/index.ts:305-306)🛠️ Proposed fix - add Chinese spell check mappings
Add the following entries to
apps/desktop/src/shared/constants/spellcheck.ts:Both
zh-CNandzh-TWare supported by Chromium's spell checker in Electron 40.0.0 on Windows, Linux, and macOS.🤖 Prompt for AI Agents