Skip to content

test(i18n): hold zh-CN to the English-leak guard - #1674

Merged
MBombeck merged 9 commits into
MBombeck:release/v1.50.0from
Remedy233:feat/150-zh-leak-guard
Nov 30, 2026
Merged

MBombeck merged 9 commits into
MBombeck:release/v1.50.0from
Remedy233:feat/150-zh-leak-guard

Conversation

@Remedy233

Copy link
Copy Markdown

What this does

Puts zh-CN under the English-leak guard.

LEAK_LOCALES names the bundles that must never echo English. zh-CN was not
in it, so a Chinese value copied from en.json would have passed every guard
in the suite: the existing guards prove key-shape parity, that no key is
empty, and that placeholders survive — none of them can tell a translated
string from a copied one.

The allowlist entry

One key needed adding:

// Telegram calls the field "Chat ID" in Chinese too.
"settings.chatId",

The delta was computed with the guard's own algorithm rather than guessed. Of
the values that are byte-identical to English, 28 are already either
allowlisted, a URL, a mask placeholder, or a single token — leaving exactly
this one.

Checks

  • tsc --noEmit: clean
  • ported guard algorithm over all 13,019 strings: findings=0

Depends on

The zh-CN bundle PR — the guard reads messages/zh-CN.json, so this is stacked
on that branch and should merge after it.

`LEAK_LOCALES` names the bundles that must never echo English; `zh-CN` was
not in it, so a Chinese value copied from `en.json` would have passed every
guard. This adds it and the single allowlist entry that was needed:
`settings.chatId` is "Chat ID" in Chinese Telegram clients too, because that
is the name of the field.

The delta was computed with the guard's own algorithm rather than guessed:
of the 29 multi-word values that are byte-identical to english, 28 are already
either allowlisted, a URL, a mask placeholder, or a single token.

Depends on the zh-CN bundle PR: the guard reads `messages/zh-CN.json`.
@MBombeck
MBombeck merged commit 4cfd8e6 into MBombeck:release/v1.50.0 Nov 30, 2026
41 checks passed
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