Complete English localization for desktop and web UI#44
Conversation
There was a problem hiding this comment.
Pull request overview
This PR completes English localization coverage across the app (desktop PyQt + web NiceGUI) by replacing remaining hardcoded Chinese UI strings with translation lookups and expanding the locale dictionaries. It also addresses a functional bug where preset model configurations failed to apply in English mode due to translated labels being used for internal dict lookups.
Changes:
- Replaced hardcoded UI/user-facing strings in core + web modules with
tr()keys (and added supporting locale entries). - Expanded
locales/en_US.jsonandlocales/zh_CN.jsonwith 290+ new translation keys across many UI sections. - Adjusted several core services/managers (auth, monitoring, remote management, validation, exporting, skills/plugins, etc.) to emit localized messages.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| occm_web/auth.py | Localizes login/change-password UI labels and API messages. |
| occm_web/app.py | Updates global exception log message wording (developer-facing). |
| occm_web/main.py | Localizes CLI help text and startup console messages to English. |
| occm_core/version_checker.py | Localizes rate-limit/network error strings. |
| occm_core/skill_manager.py | Localizes validation/errors and install/update progress messaging. |
| occm_core/remote_manager.py | Localizes connection/config errors and remote operation failures. |
| occm_core/plugin_manager.py | Localizes plugin install/uninstall/version-check error output. |
| occm_core/native_providers.py | Adjusts provider display names to remove embedded Chinese text. |
| occm_core/monitor_service.py | Localizes monitor status/error messages. |
| occm_core/config_validator.py | Localizes validation issue messages and summary output. |
| occm_core/config_manager.py | Localizes JSON/JSONC parse failure diagnostics. |
| occm_core/cli_export.py | Localizes export/validation error messages and CLI export failures. |
| occm_core/agent_groups.py | Localizes agent group preset names/descriptions and CRUD error output. |
| locales/zh_CN.json | Adds/normalizes many zh_CN translation keys referenced by new tr() calls. |
| locales/en_US.json | Adds/normalizes many en_US translation keys referenced by new tr() calls. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| NativeProviderConfig( | ||
| id="zhipuai", | ||
| name="Zhipu AI (智谱GLM)", | ||
| name="Zhipu AI", | ||
| sdk="@ai-sdk/openai-compatible", |
There was a problem hiding this comment.
NativeProviderConfig.name is still hardcoded and was changed to English-only here. The web/desktop UIs render this field directly (without tr()), so zh_CN users will also lose localized provider names. Consider keeping language-neutral data here and localizing provider display names at the UI layer via translation keys (e.g., based on provider id).
Summary
Eliminates all Chinese text from the English UI across both the desktop (PyQt5) and web (NiceGUI) editions. Adds 290+ bilingual translation keys and fixes a functional bug where preset model configurations silently failed to apply in English mode.
Problem
With English (en_US) selected as the display language, hardcoded Chinese strings were still visible throughout the UI — in tooltips, dialog titles, button labels, status messages, preset descriptions, authentication pages, and more.
Changes
Locale files — locales/en_US.json, locales/zh_CN.json
Desktop monolith — opencode_config_manager_fluent.py
Core modules — occm_core/ (8 files)
Web edition — occm_web/ (3 files)
Bug fix
Fixed a functional bug where preset model configurations (Claude, OpenAI, Gemini, etc.) silently failed to apply in English mode. Root cause: internal lookup functions (_custom_resolve_model_category, _resolve_category_for_preset, _get_category_bulk_support, _custom_apply_batch_config) were returning tr()-translated values (e.g. "Claude Series") to look up keys in MODEL_PRESET_PACKS which uses Chinese keys ("Claude 系列"). Fixed by reverting these functions to return raw Chinese keys for internal dict lookup, while keeping _get_group_key() translated for UI display.
What was NOT changed