intel / intel/AI-Playground

Chinese (zh-CN) localization is broken: wizard language switch doesn't take effect, hardcoded English strings remain, and some keys are untranslated

Open
#570 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
979
Forks
132
Avg merge
9h 23m
Merged PRs (30d)
8

Description

## Summary

Chinese (zh-CN) localization is broken in AI Playground v3.1.2-beta. After selecting 简体中文, the UI remains mostly English due to three distinct problems: (1) the language choice in the setup wizard never takes effect, (2) many UI strings are hardcoded English and bypass the i18n system entirely, and (3) some zh-CN.json keys still contain English values.

## Environment

- Windows 11 (10.0.26220)
- AI Playground v3.1.2-beta (packaged Windows installer)
- Hardware: Intel Arc A770 (16GB)

## Problem 1 — The language selection in the Setup wizard does not take effect

Steps to reproduce:

1. Fresh install → the "AI Playground Setup" wizard appears.
2. In the language dropdown (top-left) select **简体中文**.
3. The entire wizard UI stays in English (HARDWARE MODE, COMPONENTS, Install & Continue, etc.).
4. After installation, the main UI also launches fully in English.

Root cause (from `WebUI/src/assets/js/store/i18n.ts`): the wizard's `LanguageSelector` calls `changeLanguage()` → `switchLanguage()`, which persists to `localStorage.setItem('locale', lang)`. But the app's `init()` gives priority to `window.electronAPI.getLocaleSettings()` → `languageOverride` (App Settings → Basic → Language), so the wizard's choice is silently ignored. Users must manually switch the language again inside App Settings after every install — most users will never find it.

## Problem 2 — Many UI strings are hardcoded English and never go through i18n

Even after switching to 简体中文 in App Settings, large parts of the UI remain English because the strings are hardcoded in components instead of using `languages.*` keys. Verified examples in `WebUI/src/components/SettingsBasic.vue`:

- `Speech To Text` (line ~93)
- `Device` (line ~107)
- `Fallback transcription endpoint` (line ~119)
- `Base URL` / `Model` / `API key` (lines ~139/146/150)
- `Text To Speech` / `Speak replies to voice input` / `Fallback speech endpoint` (lines ~162/176/196)
- `Base URL` / `Model` / `Voice` / `API key` (lines ~215/222/226/230)

PR #488 ("externalize hardcoded UI strings, add Hebrew translation and RTL support") was merged but these strings were missed. A full codebase sweep for remaining hardcoded English strings is needed.

## Problem 3 — Several zh-CN.json keys still contain English values

`WebUI/src/assets/i18n/zh-CN.json` has 427 keys; 20 of them are untranslated English. Examples:

- `MODE_CHAT` => "Chat"
- `MODE_IMAGE_GEN` => "Image Gen"
- `MODE_IMAGE_EDIT` => "Image Edit"
- `MODE_VIDEO` => "Video"
- `ANSWER_AI_NAME` => "Playground"

Some are brand names ("AI PLAYGROUND", "HuggingFace", "LoRA", "CFG", "HD") and acceptable as-is, but the mode tabs (Chat / Image Gen / Image Edit / Video) are core navigation UI and should be translated.

## Expected Behavior

1. Selecting 简体中文 in the setup wizard should make the whole app Chinese immediately and persist across restarts.
2. Every user-facing string should be routed through the i18n system (no hardcoded English in components).
3. zh-CN.json should have complete translations for all keys.

## Suggested Fixes

1. **Unify the language persistence path**: make the wizard's `LanguageSelector` write to the same `languageOverride` that the main app reads, or make `init()` respect `localStorage` reliably.
2. **Complete the externalization sweep** started in #488: replace remaining hardcoded English strings in components with `languages.*` keys.
3. **Translate the remaining 20 keys** in zh-CN.json.

## Note

The translation infrastructure itself is actually solid — ~95% of zh-CN keys are properly translated. The issue is purely the incomplete integration: broken language persistence from the wizard and missed hardcoded strings. This affects all 13 supported languages, not just Chinese.

Thank you for the great app — it runs beautifully on the Arc A770!

Contributor guide

Open the contributing guide

Research direction

Start with WebUI/src/assets/js/store/i18n.ts and trace how the wizard’s LanguageSelector persists its choice versus how init() reads locale settings. Then inspect the named hardcoded strings in WebUI/src/components/SettingsBasic.vue and the remaining English values in WebUI/src/assets/i18n/zh-CN.json. Done means the wizard language applies and persists, user-facing strings use i18n keys, and the identified Chinese translations are complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, internationalization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.