Skip to content

test(web): guard against single-brace i18n placeholders - #523

Merged
Yevanchen merged 2 commits into
mainfrom
test/web-i18n-placeholder-guard
Aug 21, 2026
Merged

test(web): guard against single-brace i18n placeholders#523
Yevanchen merged 2 commits into
mainfrom
test/web-i18n-placeholder-guard

Conversation

@Yevanchen

Copy link
Copy Markdown
Collaborator

Fill what changed. Use N/A for irrelevant or maintainer-only items. See CONTRIBUTING.md for branch, CLA, generated file, and CI rules.

Summary

  • Add a regression test to apps/web/tests/i18n-catalog-parity.test.ts that fails when any translation catalog string contains a single-brace placeholder (e.g. {time}) that the runtime t() cannot interpolate.

Why

Verification

  • Commands: bun run test in apps/web (235 pass, 0 fail); bun run lint in apps/web (clean).
  • Manual steps: temporarily reverted threads.created in zh-CN.json to 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.
  • Not run: N/A

Impact

  • User/API/contract changes: none (test-only).
  • Generated files / GraphQL / DB / lockfile: none.
  • Env or config changes: none.
  • Risk and rollback: negligible; revert the single commit.

Review

  • Closest review areas: apps/web/tests/i18n-catalog-parity.test.ts, the t() interpolation contract in apps/web/src/shared/i18n/provider.tsx.
  • Known trade-offs: a translation that intentionally wants a literal {word} would trip the guard; none exists today and escaping can be revisited if one appears.

@Yevanchen
Yevanchen force-pushed the test/web-i18n-placeholder-guard branch from 4ff9ba4 to e93d79c Compare August 20, 2026 16:19
@Yevanchen
Yevanchen merged commit 3a9e408 into main Aug 21, 2026
9 checks passed
@Yevanchen
Yevanchen deleted the test/web-i18n-placeholder-guard branch August 21, 2026 10:05
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.

1 participant