Repository navigation
fix(gottext): name a translation whose tags differ from its message - #135
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
[Medium impact] The PR appears safe to merge; no actionable defects were found.
|
e8a4beb to
ccb8b90
Compare
|
Thanks for this. I rebased your branch on main and shortened your commit message to its first line, so please reset to it before you push again. I also pushed two small commits on top so we can merge it, you don't need to do anything further.
|
There was a problem hiding this comment.
Gates Passed
4 Quality Gates Passed
See analysis details in CodeScene
Quality Gate Profile: Clean Code Collective
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
Fixes #133
mismatchedin gottext compared a translation's placeholders with the ones its message names, but never looked at the tags, so a translation that added, dropped, renamed or repeated a tag passed every catalogue check and then rendered wrong undercreateInterpolateElement.This change:
gottext/src/gates.tsusing the same patterncreateInterpolateElementuses,/<(\/)?(\w+)\s*(\/)?>/g, keeping the closing slash and the self-closing slash as part of each tag, so an opening, a closing and a self closing tag count as different tags and spaces inside a tag do not count.gottext/test/build.test.tsand a changelog entry under Unreleased ingottext/CHANGELOG.md.Scope note: one "Done when" item in #133 asks for a line in
translations/health.mdin the separate docs repo. That item is not addressed here, because it does not live in this repo; everything in the issue that lives in this repo (the check, the tests, the changelog entry) is included. The catalogues that use gottext today already pass this check, so no translation changes.Verification, all from
gottexton this branch:main:npx vitest run test/build.test.ts— 95 tests, 8 failed (every "names a translation … tag" case returned[]instead of the message key), 87 passed. The pristine baseline of the same file atmainwas 83 passed.npx vitest run— 10 test files, 255 passed, including the 95 inbuild.test.ts(the 12 new tag cases among them).pnpm run typecheck— passes.pnpm run lint— passes (oxlint and eslint, 0 warnings, 0 errors).AI assistance: the change was drafted with an AI coding agent; every command above was run against this branch.
Summary by CodeRabbit