Skip to content

fix: translate ErrorBoundary fallback text - #673

Open
DevTobis wants to merge 1 commit into
drydocs:mainfrom
DevTobis:fix/646-errorboundary-i18n
Open

fix: translate ErrorBoundary fallback text#673
DevTobis wants to merge 1 commit into
drydocs:mainfrom
DevTobis:fix/646-errorboundary-i18n

Conversation

@DevTobis

Copy link
Copy Markdown

closes #646

Summary

ErrorBoundary's fallback heading and reload button were hardcoded English literals — the rest of the app is fully translated via en.json/fr.json.

Changes

  • ErrorBoundary is a class component, so the useTranslation hook can't be used directly inside it. Wrapped it with react-i18next's withTranslation HOC instead, which injects a t prop and keeps the fallback UI reactive to language changes.
  • Render the fallback heading via t("errorBoundary.title") and the button via t("errorBoundary.reload")
  • Add an errorBoundary section to apps/web/messages/en.json and fr.json
  • Update ErrorBoundary.test.tsx to mock withTranslation (matching how other component tests mock useTranslation) and assert on the translation keys

Verification

  • pnpm --filter=web test — 16 files / 90 tests passed
  • pnpm --filter=web typecheck — clean
  • pnpm --filter=web lint — clean

Wrap ErrorBoundary with react-i18next's withTranslation HOC (it's a
class component, so the useTranslation hook doesn't apply) and route
the fallback heading and reload button through errorBoundary.title /
errorBoundary.reload in en.json and fr.json.
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

@DevTobis is attempting to deploy a commit to the Collins' projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@DevTobis Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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] ErrorBoundary fallback text is not translated

1 participant