Skip to content

feat(i18n): fully translate the Vietnamese WebUI - #1782

Open
ITmrHoang wants to merge 1 commit into
harry0703:mainfrom
ITmrHoang:feat/vi-full-translation
Open

ITmrHoang wants to merge 1 commit into
harry0703:mainfrom
ITmrHoang:feat/vi-full-translation

Conversation

@ITmrHoang

Copy link
Copy Markdown

Summary

The Vietnamese locale covered only the keys required for secondary locales, so about 257 strings still showed in English: provider setup tips, generation progress, AI video quotes and charge confirmations, diagnostic logging, and the Kimi/Codex/ChatGPT OAuth flows. This PR translates all of them, so vi.json now covers all 763 keys in en.json.

Changes

  • webui/i18n/vi.json: adds the missing translations. Existing keys are reordered to match en.json; no existing translation changed. Placeholders ({...}) and Markdown link targets are identical to English. In the provider tips, the field labels **API Key** / **Base Url** / **Model Name** stay in English, as in zh.json.
  • webui/Main.py: get_llm_provider_tips and get_tts_provider_tips now use _provider_tips_language(). That function picks the UI language when it is in FULLY_TRANSLATED_TIPS_LOCALES (zh, en, vi) and the locale has that tip, and falls back to English per key otherwise. Non-zh languages prefer the international service endpoint, as en already did.
  • test/services/test_webui_i18n.py: adds FULLY_TRANSLATED_LOCALES = ("vi",). These locales are exempt from the "do not duplicate provider tips / English fallback keys" checks. A new test requires them to cover every English key with matching placeholders and URLs.

Note on maintenance policy

This relaxes the current rule that only zh/en maintain provider tips, for vi only. Every other secondary locale behaves as before. When new English keys are added, the new test will flag missing Vietnamese strings. If you would rather keep the zh/en-only policy, I can drop the tips and fallback keys from this PR.

Testing

  • pytest test/services/test_webui_i18n.py test/services/test_llm.py test/services/test_codex_i18n.py test/services/test_chatgpt_i18n.py: 200 passed.
  • Full test/services run on Windows: 3202 passed, 3 failed. The 3 failures also happen on main without this change and come from Windows limits: a long image file name, and symlink creation that needs admin privileges.
  • Started the WebUI, switched to Tiếng Việt, and checked that the main page and the LLM settings tips (Kimi) render in Vietnamese.

🤖 Generated with Claude Code

Add the 257 strings vi.json was missing (provider setup tips, generation
progress, AI video quotes, diagnostic logging, OAuth flows), so the
Vietnamese UI no longer falls back to English.

Provider tips now render in any locale listed in
FULLY_TRANSLATED_TIPS_LOCALES (zh, en, vi), falling back to English per
key. The i18n tests treat vi as a fully translated locale: it must cover
every English key with matching placeholders and URLs.
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