Skip to content

fix(i18n): require an explicit locale on presentation helpers - #4640

Open
orangeCatDeveloper wants to merge 1 commit into
apache:mainfrom
orangeCatDeveloper:fix/locale-silent-defaults
Open

fix(i18n): require an explicit locale on presentation helpers#4640
orangeCatDeveloper wants to merge 1 commit into
apache:mainfrom
orangeCatDeveloper:fix/locale-silent-defaults

Conversation

@orangeCatDeveloper

Copy link
Copy Markdown
Contributor

Summary

Presentation helpers across desktop renderer, @maka/core, and @maka/ui defaulted their locale parameter to 'zh', so a caller that forgot to pass it rendered Chinese to English users with no type error. This PR removes every such default (24 helpers, 23 files) so the locale is a required argument. No production caller relied on a default — every one already passed the locale it had in scope — so the runtime behavior is unchanged; only the type-level guarantee is new. Tests that leaned on the default now pass 'zh' explicitly, and each touched helper gained one 'en' assertion so the English path is proven rather than assumed.

The six @maka/ui streaming helpers with the same defect are fixed in #4524 and are not touched here; the two OAuth result helpers are fixed in #4551.

Refs #2672

Verification

workspace typecheck:                    0 errors
packages/core tests:                    774 pass / 0 fail
packages/ui tests:                      334 pass / 0 fail
desktop main tests (dist):              1995 pass / 0 fail
renderer architecture check:            passed against origin/main
biome (changed files):                  clean
git grep "locale: UiLocale = 'zh'|locale ?? 'zh'" (non-test): only the #4524 / #4551 sites remain

AI use

Select exactly one:

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

Tool(s) and scope: Claude Code — implementation, tests, and this description, under the contributor's direction; the commit carries a Generated-by: Claude Code trailer.

Checklist

  • Tests cover the change and fail without it

A `'zh'` default let any caller that forgot the locale render Chinese to
English users without a type error.

Generated-by: Claude Code
@github-actions github-actions Bot added the effort/M Under 500 readable lines label Sep 3, 2026
@orangeCatDeveloper
orangeCatDeveloper marked this pull request as ready for review September 3, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant