Skip to content

Add Vietnamese i18n support (vi locale)#507

Open
hthienloc wants to merge 1 commit intosiddharthvaddem:mainfrom
hthienloc:add-vietnamese-i18n-1022783609047552672
Open

Add Vietnamese i18n support (vi locale)#507
hthienloc wants to merge 1 commit intosiddharthvaddem:mainfrom
hthienloc:add-vietnamese-i18n-1022783609047552672

Conversation

@hthienloc
Copy link
Copy Markdown

@hthienloc hthienloc commented Apr 30, 2026

Summary

  • Add Vietnamese locale support (vi) for OpenScreen
  • Translate all 7 i18n files: common, dialogs, editor, launch, settings, shortcuts, timeline
  • Update electron/i18n.ts to include Vietnamese locale support

Changes

  • Created src/i18n/locales/vi/ with 7 translated JSON files
  • Added Vietnamese to Locale type and message mappings in electron/i18n.ts
  • Follows existing i18n patterns (same format as es, fr, ja-JP, etc.)

Testing

  • JSON syntax valid
  • All translation keys preserved
  • Added "vi" to locale detection logic

Ready for review! 🎉

Summary by CodeRabbit

  • New Features
    • Vietnamese language support is now available throughout the entire application. All user-facing content has been fully translated, including the editor interface, timeline controls, settings panel, keyboard shortcuts, file dialogs, playback controls, action buttons, and informational messages. Vietnamese-speaking users can now access and use the entire application in their native language.

Co-authored-by: hthienloc <148019203+hthienloc@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

📝 Walkthrough

Walkthrough

Adding 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

Cohort / File(s) Summary
Locale Registration
electron/i18n.ts
Extended Locale type union to include "vi", imported 7 Vietnamese JSON locale files, registered Vietnamese message bundles in the messages map, and updated setMainLocale to accept Vietnamese.
Vietnamese Translation Files
src/i18n/locales/vi/common.json, src/i18n/locales/vi/dialogs.json, src/i18n/locales/vi/editor.json, src/i18n/locales/vi/launch.json, src/i18n/locales/vi/settings.json, src/i18n/locales/vi/shortcuts.json, src/i18n/locales/vi/timeline.json
Added 7 new Vietnamese locale resource files covering UI labels, dialogs, editor strings, launch controls, settings options, keyboard shortcuts, and timeline actions with proper placeholder support ({{key}}-style interpolation).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • openscreen#472: Prior similar localization additions for ja-JP, ko-KR, tr, and zh-TW that extended electron/i18n.ts with the same registration pattern.
  • openscreen#380: Earlier localization work also extending the Locale type and updating the i18n registration flow.

Suggested reviewers

  • siddharthvaddem

Poem

🇻🇳 new voices whisper through the code tonight
vietnamese strings dance in json's soft light
"xin chào" echoes where english once stood alone
seven files deep, a language finds home 🌍

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding Vietnamese (vi) locale support to the application.
Description check ✅ Passed The description covers summary, changes, and testing sections, but lacks details on motivation, related issues, and formal type of change selection from the template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@hthienloc hthienloc marked this pull request as draft April 30, 2026 16:40
@hthienloc hthienloc marked this pull request as ready for review April 30, 2026 16:42
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

vi support 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.ts still excludes "vi" from SUPPORTED_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

📥 Commits

Reviewing files that changed from the base of the PR and between 884021c and 37c1ea5.

📒 Files selected for processing (8)
  • electron/i18n.ts
  • src/i18n/locales/vi/common.json
  • src/i18n/locales/vi/dialogs.json
  • src/i18n/locales/vi/editor.json
  • src/i18n/locales/vi/launch.json
  • src/i18n/locales/vi/settings.json
  • src/i18n/locales/vi/shortcuts.json
  • src/i18n/locales/vi/timeline.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant