Skip to content

fix(swap): make the popular tokens heading translatable - #3136

Open
shivam-V8 wants to merge 1 commit into
aave:mainfrom
shivam-V8:fix/3135-translatable-popular-heading
Open

shivam-V8 wants to merge 1 commit into
aave:mainfrom
shivam-V8:fix/3135-translatable-popular-heading

Conversation

@shivam-V8

@shivam-V8 shivam-V8 commented Oct 14, 2026 •

Copy link
Copy Markdown

The heading was passed to Trans as a runtime variable, so lingui extracted the variable name and the catalogs carried the msgid {popularSectionTitle} instead of the text. Neither heading could be translated in any locale. Branch on the JSX so both literals are statically extractable.

Closes #3135

General Changes

Developer Notes

Root cause — the heading was built as a runtime variable and then passed to <Trans>:

const popularSectionTitle = recentAssets.length > 0 ? 'Recently used & Popular' : 'Popular';
// …
<Trans>{popularSectionTitle}</Trans>

lingui extracts the expression, not the strings behind it, so the committed catalog carried the variable name itself

(src/locales/en/messages.po):

msgid "{popularSectionTitle}"
msgstr "{popularSectionTitle}"

Neither real string appeared as a msgid anywhere in src/locales/, so no locale could translate either one and every user saw English. SwitchAssetInput is shared by all five swap flows (swap, collateral swap, debt swap, repay with collateral, withdraw and swap), so the untranslated heading showed in each of them.

Change — branch on the JSX so both literals are statically analysable, and drop the now-unused variable:

{recentAssets.length > 0 ? (
  <Trans>Recently used &amp; Popular</Trans>
) : (
  <Trans>Popular</Trans>
)}

Evidence — the catalog diff after pnpm i18n is the proof that the extraction now works:

-msgid "{popularSectionTitle}"
+msgid "Recently used & Popular"
+msgid "Popular"

The regenerated catalogs are included in the commit, and a second pnpm i18n run produces no further diff, so i18n-check passes.

Tests — none added. There is no pure logic here to unit test; the catalog diff above is the verification. tsc --noEmit and next lint are both clean for the changed file (lint would also have caught the removedl referenced it), and the jest suite is unchanged.

Related, not included — the same pattern appears once more ineTitle || 'Balance'}. I left it out to keep this change to the reported bug; happy to fold it in or send a follow-up, whichever you prefer.

Pre-existing failures — the 4 jest suites in src/utils/ that fail on main (a wagmi/chains import issue) are unaffected.


Reviewer Checklist

Please ensure you, as the reviewer(s), have gone through this checklist to ensure that the code changes are ready to ship safely and to help mitigate any downstream issues that may occur.

  • End-to-end tests are passing without any errors
  • Code changes do not significantly increase the application bundle size
  • If there are new 3rd-party packages, they do not introdeats
  • If there are new environment variables being added, they have been added to the .env.example file as well as the pertinant .github/actions/* files
  • There are no CI changes, or they have been approved by the DevOps and Engineering team(s)

Related work

Part of a set of small, independently reviewable fixes found while testing the v3 uplift. Each closes its own issue, touches one concern, and branches from main, so they can be reviewed and merged in any order:

@vercel

vercel Bot commented Oct 14, 2026

Copy link
Copy Markdown

@Krshivam25 is attempting to deploy a commit to the Aave Team on Vercel.

A member of the Team first needs to authorize it.

The heading was passed to Trans as a runtime variable, so lingui extracted the
variable name and the catalogs carried the msgid {popularSectionTitle} instead of
the text. Neither heading could be translated in any locale. Branch on the JSX so
both literals are statically extractable.

Closes aave#3135
@shivam-V8
shivam-V8 force-pushed the fix/3135-translatable-popular-heading branch from 92c8fa4 to bd77c88 Compare October 24, 2026 08:38

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment