Skip to content

fix(ci): widen the locale hygiene gate to its blind spots - #5180

Open
orangeCatDeveloper wants to merge 1 commit into
apache:mainfrom
orangeCatDeveloper:fix/locale-hygiene-coverage
Open

fix(ci): widen the locale hygiene gate to its blind spots#5180
orangeCatDeveloper wants to merge 1 commit into
apache:mainfrom
orangeCatDeveloper:fix/locale-hygiene-coverage

Conversation

@orangeCatDeveloper

@orangeCatDeveloper orangeCatDeveloper commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #2672

Summary

Runtime Host handoff treated every non-English locale as Chinese, while classified bot failures switched a Chinese-only surface to English. Multiline native-dialog literals also escaped the locale hygiene gate.

The live shortcuts now use a typed catalog or an explicit surface locale. The ratchet also scans Runtime Host and complete source files, rejecting these shortcuts and literal native-dialog copy without requiring historical cleanup.

Verification

Known live wrong-language shortcuts: 2/2 before → 0/2 after.

Before

origin/main:apps/desktop/src/main/bot-incoming-main.ts:395:        : generalizedErrorMessage(error, '机器人对话处理失败');
origin/main:packages/runtime-host/src/client/host-handoff-copy.ts:33:  const zh = locale !== 'en';

After

0 matches
check-locale-hygiene                 passed
check-locale-hygiene.test.mjs        7 pass / 0 fail
npm run format:check                 2,099 files clean
CI test                              passed

The bot regression test renders the classified timeout in the surface locale:

Maka 暂时无法处理这条消息:请求超时

The native-dialog rule is intentionally source-based and install-free. It covers inline showOpenDialog and showSaveDialog string literals within 400 characters of the call; computed option objects remain outside its boundary.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Claude Code and Codex — identified and repaired the locale shortcuts, extended the hygiene gate and tests, and updated the verification evidence. The commit carries the corresponding Generated-by trailers.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@github-actions github-actions Bot added the effort/S Under 100 readable lines label Sep 11, 2026
Locale shortcuts in Runtime Host copy and bot error handling could silently select the wrong language, while multiline native dialogs escaped the source gate. Use typed catalogs and explicit locale-aware rendering, then scan complete source files so these patterns cannot return.

Generated-by: Claude Code
Generated-by: Codex
@orangeCatDeveloper
orangeCatDeveloper force-pushed the fix/locale-hygiene-coverage branch from ce47b7e to a965d52 Compare September 13, 2026 03:00
@github-actions github-actions Bot added effort/L Under 1000 readable lines and removed effort/S Under 100 readable lines labels Sep 13, 2026
@orangeCatDeveloper
orangeCatDeveloper marked this pull request as ready for review September 13, 2026 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/L Under 1000 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC] Define one i18n contract across Maka surfaces

1 participant