Repository navigation
fix(i18n): stop double-escaping interpolated values and clean up i18n keys - #1541
Merged
theborakompanioni merged 6 commits intoNov 2, 2026
Merged
theborakompanioni merged 6 commits into
theborakompanioni merged 6 commits into
Conversation
bhuvan-somisetty
force-pushed
the
i18n/cleanup-dead-keys
branch
from
October 22, 2026 19:11
2950211 to
bed640c
Compare
Contributor
Author
|
rebased and added one more commit: the locale test now also checks that translations keep the en variables, Trans tags and plural forms. it caught a few real ones, e.g. ru showed "3 entries" in english because the few/many forms were missing. fixed all of them, details in the description |
i18next escapes interpolated values by default. React escapes rendered text on its own, so values were escaped twice and entities showed up in the UI, e.g. searching the logs for "won't" displayed `No matches for "won&joinmarket-webui#39;t".` and error reasons containing `/`, `'` or `&` were mangled in toasts and alerts. Disable `interpolation.escapeValue`, as recommended for react-i18next. No translated text is rendered as raw HTML. Signed-off-by: bhuvan-somisetty <somisettybhuvan5@gmail.com>
- localize the rescan shortcut buttons and the segwit activation tooltip - add distinct titles for the sidebar trigger (open/close) - give the branch address table its own keys and an index column label - move shared keys (copied address toast, jar badge label) to `global` - pass the reason as a param in the `minimum_makers` error toast - rename the `defaultValue` interpolation param, which collides with an i18next option, to `defaultPercentage` - remove 5 unused keys from all locales and 42 stale keys from the translated locales that no longer exist in the source language - add tests that guard nested `$t()` references, orphaned keys and unknown interpolation variables across all locales Signed-off-by: bhuvan-somisetty <somisettybhuvan5@gmail.com>
Signed-off-by: bhuvan-somisetty <somisettybhuvan5@gmail.com>
Extends the locales test to also check that translations - keep every interpolation variable of the source string (except count) - use the same <Trans> components as the source string - contain every plural form their language needs (per Intl.PluralRules) and fixes what it found: - de/it/pt-BR/ru/zh-Hans/zh-Hant dropped the reason from the fee config loading error - de showed the "fund wallet" hint with the wrong count in the scheduler confirmations hint - fr dropped the fee from the absolute fee label and rendered stray <0> tags in the lock wallet modal - ru had no few/many forms, so e.g. "3 entries" was shown in English - it/pt-BR had no many forms (only used for large numbers) Signed-off-by: bhuvan-somisetty <somisettybhuvan5@gmail.com>
bhuvan-somisetty
force-pushed
the
i18n/cleanup-dead-keys
branch
from
October 22, 2026 22:28
bed640c to
0811ac5
Compare
…keys Signed-off-by: bhuvan-somisetty <somisettybhuvan5@gmail.com> # Conflicts: # src/i18n/locales/de/translation.json
theborakompanioni
approved these changes
Nov 2, 2026
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 does this PR do?
won't) #15401. Bug fix: interpolated values were HTML-escaped twice (
fix(i18n)commit)i18next escapes interpolated values by default, and React escapes rendered text again. Anything with
',/,&,<or"in a{{ value }}came out as entities, e.g. log search, error reasons in toasts and alerts. This setsinterpolation.escapeValue: false, which is what react-i18next recommends. I checked that no translated text is rendered as raw HTML (nodangerouslySetInnerHTMLanywhere insrc).2. Cleanup: open i18n TODOs and stale keys (
chore(i18n)commit)undefinedwhile collapsed)jar_details.address_list.*keys instead of borrowing the UTXO list onesglobal(copied-address toast used by 4 components, jar badge label). Existing translations were carried over, so nothing falls back to Englishminimum_makerserror toast: reason passed as a param instead of string concatenationen. Keys used via$t()nesting were kept; I checked each onesrc/i18n/locales.test.ts, which fails if a$t()nested reference doesn't resolve, a locale has keys missing inen, or a translation uses an interpolation variableendoesn't know3. Locales out of sync with
en(fix(i18n): keep variables...commit, added 10-22)The locales test now also fails if a translation drops a variable of the
enstring, uses different<Trans>components, or misses a plural form its language needs (perIntl.PluralRules). Fixed what it found:<0>tags in the lock wallet modalfew/manyforms, so e.g. 3 or 5 entries fell back to English ("3 entries"); now "3 записи", "5 записей"manyforms (only used for large numbers like 1 000 000)Rebased onto
devel; the rescan shortcut buttons were dropped from this PR sincedevelalready localized them.The first commit is independent of the rest, so I can split it into a separate PR if you prefer.
Sweep form strings are left out on purpose; they are covered in #1533.
Testing
npx vitest run --project unit: 1143 tests, all pass (oneImportDetailsFormtest timed out once under full-suite load on my machine and passes on its own)tsc -b,eslintandprettier --checkare clean.Visual Demo (For contributors especially)
Image Demo (if applicable):
Real
LogViewerin Storybook (en), searching forwon't connect: