test(web): guard against single-brace i18n placeholders - #523
Merged
Conversation
Yevanchen
force-pushed
the
test/web-i18n-placeholder-guard
branch
2 times, most recently
from
August 19, 2026 16:14
249a57c to
4ff9ba4
Compare
Yevanchen
force-pushed
the
test/web-i18n-placeholder-guard
branch
from
August 20, 2026 16:19
4ff9ba4 to
e93d79c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fill what changed. Use N/A for irrelevant or maintainer-only items. See
CONTRIBUTING.mdfor branch, CLA, generated file, and CI rules.Summary
apps/web/tests/i18n-catalog-parity.test.tsthat fails when any translation catalog string contains a single-brace placeholder (e.g.{time}) that the runtimet()cannot interpolate.Why
创建于 {time}. The root cause was single-brace placeholders in the translation catalogs, whilet()only substitutes{{name}}; fix(web): interpolate thread translation variables #522 fixed the strings, but nothing prevented the same defect class from coming back. The existing parity test only compares{{name}}variables across locales, so a{name}typo present in all locales (as it was pre-fix(web): interpolate thread translation variables #522) passes unnoticed.Verification
bun run testinapps/web(235 pass, 0 fail);bun run lintinapps/web(clean).threads.createdinzh-CN.jsonto the pre-fix(web): interpolate thread translation variables #522 single-brace form创建于 {time}and confirmed the new test fails with the offending key/locale, then restored the file.Impact
Review
apps/web/tests/i18n-catalog-parity.test.ts, thet()interpolation contract inapps/web/src/shared/i18n/provider.tsx.{word}would trip the guard; none exists today and escaping can be revisited if one appears.