Repository navigation
fix(client): show the progress saving notice once in the info popup - #565
Merged
joneugster merged 1 commit intoOct 4, 2026
Conversation
The info popup rendered the "Progress saving" description twice (a duplicated <Trans> from leanprover-community#437). Its sections were also wrapped in a key-less <Trans> although each one is already translated on its own; i18next-scanner cannot parse the t() calls inside it and writes an empty junk key into every locale file. Replace the wrapper with a fragment and drop the duplicate, and add a Cypress test for the info popup.
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.
What was wrong
The "Game Info" popup shows the "Progress saving" paragraph twice: #437 duplicated the
<Trans i18nKey="Progress saving.description">element inclient/src/components/popup/info.tsx.The same block is also wrapped in a
<Trans>without a key, although every heading and paragraph inside it is already translated on its own (t(...)or<Trans i18nKey=...>). That wrapper is whatnpm run translatetrips over in #553: i18next-scanner reports "Unsupported JSX expression ... Got CallExpression" for the fourt("….translation", …)headings, and then writes an empty key"<0></0><1><0></0><1></1></1>…": ""into every locale file. At runtime no locale has that key, so the wrapper only renders its children unchanged.What this changes
<Trans>for the progress-saving text.<Trans>with a fragment. Rendered output is otherwise unchanged.describe('Info')block incypress/e2e/01-basic-interface.cy.tswith a test that opens the info popup in TestGame and checks the progress-saving text appears once.This addresses the parse errors listed in #553. It does not touch the separate problem in that issue where the scanner flattens nested keys (
"Development notes": {…}→"Development notes.translation").How it was tested
npm start): the new test fails onmainwithexpected 2 to equal 1and passes with the change. With the change,01-basic-interface.cy.tspasses 6/6.game-features.cy.tsgives 4 passing and 16 failing both with and without the change (on my machine the level pages never show "Assumptions:"), so I could not confirm that spec locally.npx i18next-scanner --config i18next-scanner.config.cjsinclient/: 4 "Unsupported JSX expression" errors before, none after; the junk key is no longer added to any of the 10 locale files, and the rest of the scanner's output is the same as before. (I reverted the locale files afterwards; this PR does not include a scanner run.)npm run build:clientsucceeds.