Skip to content

Complete English localization for desktop and web UI#44

Open
Qyperion wants to merge 7 commits into
icysaintdx:mainfrom
Qyperion:fix-missing-localization
Open

Complete English localization for desktop and web UI#44
Qyperion wants to merge 7 commits into
icysaintdx:mainfrom
Qyperion:fix-missing-localization

Conversation

@Qyperion
Copy link
Copy Markdown

@Qyperion Qyperion commented Mar 4, 2026

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

  • Added 290+ translation keys across ~20 sections: tooltips, preset descriptions (agents, categories, models), dialog titles, status messages, validation errors, and more

Desktop monolith — opencode_config_manager_fluent.py

  • Replaced ~500 hardcoded Chinese UI strings with tr() calls
  • Tooltips now resolved via get_tooltip(key) which tries tr("tooltip.") first, falling back to the Chinese dict value
  • Preset descriptions resolved via _tr_preset(section, key, fallback) with the same fallback pattern

Core modules — occm_core/ (8 files)

  • config_manager.py, config_validator.py — validation messages, dialog text
  • remote_manager.py, monitor_service.py, version_checker.py — network status, update prompts
  • agent_groups.py, cli_export.py — group management labels, export messages
  • native_providers.py, plugin_manager.py, skill_manager.py — provider/plugin/skill UI text

Web edition — occm_web/ (3 files)

  • main.py — startup messages
  • app.py — application title
  • auth.py — login/registration page labels and validation messages

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

  • Code comments and docstrings — internal, not user-facing
  • Internal log messages — developer-facing only
  • Dict keys used for internal lookup (e.g. MODEL_PRESET_PACKS, MODEL_PRESET_DEFAULT) — translated at the point of UI display, not at the data layer
  • occm_core/i18n.py and occm_web/i18n_web.py — i18n infrastructure unchanged

Copilot AI review requested due to automatic review settings March 4, 2026 13:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.json and locales/zh_CN.json with 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.

Comment on lines 230 to 233
NativeProviderConfig(
id="zhipuai",
name="Zhipu AI (智谱GLM)",
name="Zhipu AI",
sdk="@ai-sdk/openai-compatible",
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
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.

2 participants