Skip to content

feat(i18n): localize toast notifications and placement errors - #43

Merged
AlaskanTuna merged 1 commit into
mainfrom
feat/localize-toasts
Aug 25, 2026
Merged

feat(i18n): localize toast notifications and placement errors#43
AlaskanTuna merged 1 commit into
mainfrom
feat/localize-toasts

Conversation

@AlaskanTuna

Copy link
Copy Markdown
Owner

Found by a swarm audit hunting for user-facing strings that never reach a locale file — the same class of bug as the tooltips (#38) and the PDF disclaimers (#42), but larger.

The gap

23 notify.* calls used literal English; only 2 places in the whole app used t(). SolarSim advertises full en/ms/zh support, but every toast on the Workbench and Analysis pages was English-only — including the ones a user hits most while actually editing a layout.

Also three placement-rejection messages in useCanvasInteractions.ts ('That placement overlaps another panel.' and friends), which surface through notify.error when a drag is refused.

13 real user-facing strings in total. The 24th match was a comment in toastConfig.tsx, not a finding.

Changes

  • toasts blocks added to workbench.json (11 keys) and analysis.json (2 keys) in all three locales.
  • useTranslation wired into the four hooks that own these messages — useCanvasInteractions, useWorkbenchSave, useOverlayImages, useAnalysisPdf. None of them imported it before.
  • Interpolation preserved via i18next params rather than template literals: {{count}} for panel counts, {{filename}}, {{mode}}, {{reason}}.
  • getPlacementErrorMessage now takes TFunction — it is a module-level helper, so t has to be passed in rather than closed over.

Incidental fix: .gitignore broke ripgrep

Lines 46–47 were Icon[ and ] on separate lines. The canonical macOS template puts Icon[\r] on one line; split like this, Icon[ is an unclosed character class and ripgrep rejects the entire ignore file:

rg: ./.gitignore: line 46: error parsing glob 'Icon[': unclosed character class; missing ']'

That fired on every rg invocation in the repo. Replaced with Icon?, which still matches macOS's Icon\r. Verified the error is gone.

Verified

  • grep -rnE "notify\.(info|success|error|warning)\(\s*[\'"]"overfrontend/srcreturns **only a comment** — every real toast now goes throught()`.
  • All 15 locale files agree across en/ms/zh.
  • tsc --noEmit 0 errors · 216 frontend tests pass · pnpm lint pass · Prettier clean.

https://claude.ai/code/session_01URDpaxhXyPLWnUQtvowNyM

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 305bcef6-2473-44b3-815d-037918a4640c


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AlaskanTuna
AlaskanTuna merged commit 51f675c into main Aug 25, 2026
3 checks passed
@AlaskanTuna
AlaskanTuna deleted the feat/localize-toasts branch August 25, 2026 11:22
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.

1 participant