Skip to content

feat(i18n): add Vietnamese (vi-VN) translation - #2035

Merged
lizhengfeng101 merged 5 commits into
alibaba:mainfrom
dung997tb:vi-translation
Nov 24, 2026
Merged

lizhengfeng101 merged 5 commits into
alibaba:mainfrom
dung997tb:vi-translation

Conversation

@dung997tb

@dung997tb dung997tb commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds Vietnamese (vi-VN) as a new language, following the existing ja-JP / ko-KR / ru-RU pattern: full README and CONTRIBUTING translations under docs/i18n/, plus the pages UI locale (pages/src/i18n/vi.ts, 297/297 keys identical in set and order to en.ts) with locale registration. The VS Code extension and IDEA plugin are separate translation surfaces and are not included — happy to add them in a follow-up if wanted.

Type of Change

  • Documentation update

How Has This Been Tested?

  • Manual testing (describe below)

Verified with the repo's own gate: check-translation-sync.js readmes passes (all 8 READMEs share the same heading structure) and its self-tests pass. Key set of vi.ts verified identical to en.ts (297/297); link/image targets in both translated docs match the originals. make test was not run — this change touches documentation and UI strings only, no Go code.

Checklist

  • I have performed a self-review of my code
  • I have updated the documentation accordingly (if applicable)
  • I have signed the CLA
  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

AI disclosure: the translation was drafted with assistance from the Fable 5.2 model and then fully reviewed and corrected by me, a native Vietnamese speaker, before submitting.

(The style and tests checkboxes are left unticked: no Go code is changed, and no new tests were added — the affected component tests were updated for the new locale and the repo's translation-sync checks above were run instead.)

Related Issues

None.

@CLAassistant

CLAassistant commented Nov 22, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

🔍 OpenCodeReview found 1 issue(s) in this PR.

  • ✅ Successfully posted inline: 0 comment(s)
  • ❌ Failed to post inline: 1 comment(s)

documentation · low

📄 pages/src/content/docs/index.ts (L66-L67)

⚠️ GitHub could not post this as an inline comment: Lines 66-67 could not be resolved (outside PR diff hunks)

Stale comment: this now says "five independent chunks" but there are six language loaders (en, zh, ja, ko, ru, vi). Please update to "six".

@dung997tb

Copy link
Copy Markdown
Contributor Author

recheck

@wu21-web

Copy link
Copy Markdown
Contributor

@dung997tb Hello, thanks for taking time to contribute!

Some questions:

  1. Are you familiar with Vietnamese (native speaker)?
  2. Followed our pull request template and disclosed the use of AI?
  3. Have you reviewed your work (AI's output) and checkboxs in the template?
  4. Considered translating VSCE?
  5. Are able to maintain the translation, i.e keep up with the main branch often and translate all text?
  6. Considered the amount of speakers and whether is it nessacary? Other people with PRs opened that touched the docs section have to rebase and edit the new translation file.

@lizhengfeng101

Copy link
Copy Markdown
Contributor

@dung997tb merge conflicts

# Conflicts:
#	AGENTS.md
#	CONTRIBUTING.md
#	README.md
#	docs/i18n/CONTRIBUTING.ja-JP.md
#	docs/i18n/CONTRIBUTING.ko-KR.md
#	docs/i18n/CONTRIBUTING.ru-RU.md
#	docs/i18n/CONTRIBUTING.zh-CN.md
#	docs/i18n/README.ja-JP.md
#	docs/i18n/README.ko-KR.md
#	docs/i18n/README.ru-RU.md
#	docs/i18n/README.zh-CN.md
#	pages/src/components/Navbar.tsx
#	pages/src/content/docs/index.ts
#	pages/src/i18n/context.tsx
#	pages/src/i18n/types.ts
#	pages/src/pages/NotFoundPage.test.tsx
#	scripts/github-actions/check-translation-sync.js
@dung997tb

Copy link
Copy Markdown
Contributor Author

Hi @wu21-web, thanks for the questions — answering each:

Native speaker? Yes, Vietnamese is my native language.

PR template / AI disclosure? Honest answer: no — my PR description did not follow the template, and the AI disclosure was missing. To state it plainly here: the translation was drafted with assistance from the Fable 5.2 model and then fully reviewed and corrected by me, a native speaker, before submitting. I will also update the PR description to match the template, including the checklist and this disclosure.

Reviewed the output? Yes. Beyond my own read-through: pages/src/i18n/vi.ts matches en.ts at 297/297 keys in identical order, the repo's own check-translation-sync.js readmes gate passes, and I fixed the one issue your review bot found (the stale "five" → "six" loader comment, commit 20e063b).

Translating the VS Code extension? I considered it — extensions/frontend/src/shared/i18n.ts is a separate surface, and I left it out to keep this PR reviewable. I'm happy to translate it in a follow-up PR, or extend this one if you prefer.

Maintenance? Yes, I can maintain the Vietnamese files and keep them in sync as the source strings evolve — your sync-check script makes drift easy to spot, and I'll use it before sending updates.

Speakers / necessity, and the rebase cost? Vietnamese has roughly 100 million speakers and one of the larger developer communities in Southeast Asia, so I believe the audience is there. On the rebase burden for the other open docs PRs: you're right, and I'm sorry for the churn — the shared-file edits are one-line additions per file (language bars and locale lists), so resolving over them should be mechanical, and if any author hits a conflict because of this change I'm happy to help sort it out.

Also @lizhengfeng101 — the merge conflicts are now resolved; thanks for flagging them.

@lizhengfeng101

Copy link
Copy Markdown
Contributor

@dung997tb The French-language navigation is missing. I suggest you check which content was synced from main and whether any content was omitted and not localized.

@dung997tb

Copy link
Copy Markdown
Contributor Author

Thanks @lizhengfeng101 — you were right, and I audited the full sync after the merge rather than only the spot you flagged:

Fixed in ea464f3:

  • README.vi-VN.md navigation was missing the Turkish and French links — the French gap you spotted.
  • README.tr-TR.md, README.fr-FR.md and CONTRIBUTING.tr-TR.md were missing the Vietnamese link; CONTRIBUTING.vi-VN.md was missing the Turkish link. All 15 language navigation bars are now complete and consistent.
  • One stale sentence in CONTRIBUTING.vi-VN.md still listed the old explicit file list; updated it to match the reworded English source.

Checked and already in sync:

  • README heading structure — the repo's check-translation-sync.js gate passes for all 8 README files.
  • CONTRIBUTING heading structure — 12 sections in every locale, matching the English source.
  • pages/src/i18n/vi.ts — 297/297 keys, identical set and order to en.ts.

@dung997tb

Copy link
Copy Markdown
Contributor Author

Follow-up on the Pages CI failure (run 45383934825, check job): it was caused by my merge, and it is fixed in 6bb5137.

Root cause: resolving the merge in pages/src/components/Footer.test.tsx unioned both sides' imports, so the file ended up with two bindings named vi — vi from vitest (line 4) and the Vietnamese translations object vi from ../i18n/vi (line 14). The suite failed to parse with "Identifier vi has already been declared"; the other 131 tests passed.

Fix: the locale import is now aliased (import { vi as viLang } from '../i18n/vi', used as vi: viLang in the language table). The two other test files that import the vi locale (ProvidersSection, NotFoundPage) do not import vi from vitest, so they are unaffected.

Verification, run locally with the same toolchain as the Pages CI container (node:24.22.1): npm install, lint, test (15/15 files, 145/145 tests — the Footer suite runs again), typecheck, build, size (109 kB / 150 kB) and the smoke test (/, /docs/contributing, /docs/quickstart, /features all 200) all pass.

The hosted runs for the new head currently show action_required, so they will only execute once a maintainer approves them; the results above are from the identical container image in the meantime.

@wu21-web wu21-web left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes seem legit.

import type { Language, TranslationKeys } from '../i18n/types';

const translations: Record<Language, TranslationKeys> = { en, zh, ja, ko, ru, tr };
const translations: Record<Language, TranslationKeys> = { en, zh, ja, ko, ru, tr, vi };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is it missing fr here?

const STORAGE_KEY = 'ocr-lang';

const SUPPORTED_LANGUAGES: Language[] = ['en', 'zh', 'ja', 'ko', 'ru', 'tr'];
const SUPPORTED_LANGUAGES: Language[] = ['en', 'zh', 'ja', 'ko', 'ru', 'tr', 'vi'];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ditto, not apart of this change, but just to mention

@lizhengfeng101 lizhengfeng101 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@lizhengfeng101
lizhengfeng101 merged commit 6a7e92c into alibaba:main Nov 24, 2026
16 checks passed
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.

4 participants