Skip to content

fix(web): fix VaultPanel tab labels bypassing i18n due to variable shadowing - #474

Merged
collinsezedike merged 1 commit into
mainfrom
fix/vaultpanel-i18n-shadowing
Aug 5, 2026
Merged

fix(web): fix VaultPanel tab labels bypassing i18n due to variable shadowing#474
collinsezedike merged 1 commit into
mainfrom
fix/vaultpanel-i18n-shadowing

Conversation

@collinsezedike

Copy link
Copy Markdown
Collaborator

Summary

  • VaultPanel's tab switcher rendered "Deposit"/"Withdraw" in English only regardless of locale, because the tab-switcher's .map((t) => ...) callback parameter shadowed t from useTranslation(). Renamed it to tabId and switched the label to t(\vaultPanel.${tabId}`), using the existing vaultPanel.deposit/vaultPanel.withdrawkeys already present in bothen.jsonandfr.json`
  • Fixed the test file to match: two tests were disambiguating the tab-switcher button from the submit button by relying on the bug (raw "Withdraw" text vs. translated "vaultPanel.withdraw"). Switched both to the data-testids that already exist on the buttons (vault-tab-deposit/vault-tab-withdraw for the tabs, vault-deposit-submit/vault-withdraw-submit for the submit buttons) instead of relying on now-identical text
  • Added a regression test asserting the tab buttons render the translated key rather than a raw tab id, since the original bug had no test coverage at all

Test plan

  • pnpm --filter @meridian/web test passes: 15 test files, 72 tests, including the new regression test
  • pnpm --filter @meridian/web lint && pnpm --filter @meridian/web typecheck pass
  • pnpm exec prettier --check clean on both changed files

Closes #425

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
meridian Ready Ready Preview Aug 5, 2026 4:18pm

@collinsezedike
collinsezedike force-pushed the fix/vaultpanel-i18n-shadowing branch from 353a1c0 to 2a16fea Compare August 5, 2026 16:17
@collinsezedike
collinsezedike merged commit 85a79e4 into main Aug 5, 2026
10 checks passed
@collinsezedike
collinsezedike deleted the fix/vaultpanel-i18n-shadowing branch August 5, 2026 17:32
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.

[Bug] VaultPanel tab labels bypass i18n due to variable shadowing

1 participant