Add Vietnamese i18n support (vi locale)#507
Add Vietnamese i18n support (vi locale)#507hthienloc wants to merge 1 commit intosiddharthvaddem:mainfrom
Conversation
Co-authored-by: hthienloc <148019203+hthienloc@users.noreply.github.com>
📝 WalkthroughWalkthroughAdding Vietnamese (vi) locale support to the Electron i18n system by extending the Locale type, importing Vietnamese translation bundles (common, dialogs, editor, launch, settings, shortcuts, timeline), and registering them in the messages map for runtime access. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
electron/i18n.ts (1)
23-51:⚠️ Potential issue | 🟠 Major | ⚡ Quick win
visupport is now split between main and renderer — lowkey risky integration gap.Line 23 and Line 51 add Vietnamese in main-process i18n, but
src/i18n/config.tsstill excludes"vi"fromSUPPORTED_LOCALES(per the provided context snippet). That can make locale availability inconsistent and prevent proper renderer-side selection/validation.Quick fix
// src/i18n/config.ts export const SUPPORTED_LOCALES = [ "en", "zh-CN", "zh-TW", "es", "fr", "tr", "ko-KR", "ja-JP", + "vi", ] as const;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@electron/i18n.ts` around lines 23 - 51, The PR added Vietnamese ("vi") to the main-process i18n types and messages (see Locale, messages, currentLocale, and setMainLocale) but the renderer-side SUPPORTED_LOCALES (src/i18n/config.ts) still omits "vi", causing an inconsistent availability gap; update the renderer config to include "vi" in SUPPORTED_LOCALES and any related type unions or validation logic so both main and renderer list the same locales, and verify setMainLocale and any locale selection/validation functions accept "vi" consistently across the codebase.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@electron/i18n.ts`:
- Around line 23-51: The PR added Vietnamese ("vi") to the main-process i18n
types and messages (see Locale, messages, currentLocale, and setMainLocale) but
the renderer-side SUPPORTED_LOCALES (src/i18n/config.ts) still omits "vi",
causing an inconsistent availability gap; update the renderer config to include
"vi" in SUPPORTED_LOCALES and any related type unions or validation logic so
both main and renderer list the same locales, and verify setMainLocale and any
locale selection/validation functions accept "vi" consistently across the
codebase.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5b0f76cb-8daa-4843-88e9-14e2baaf4b9e
📒 Files selected for processing (8)
electron/i18n.tssrc/i18n/locales/vi/common.jsonsrc/i18n/locales/vi/dialogs.jsonsrc/i18n/locales/vi/editor.jsonsrc/i18n/locales/vi/launch.jsonsrc/i18n/locales/vi/settings.jsonsrc/i18n/locales/vi/shortcuts.jsonsrc/i18n/locales/vi/timeline.json
Summary
electron/i18n.tsto include Vietnamese locale supportChanges
src/i18n/locales/vi/with 7 translated JSON fileselectron/i18n.tsTesting
Ready for review! 🎉
Summary by CodeRabbit