Skip to content

fix(i18n): fr/it/ja translations silently discarded by content-script toast; popup count celebration broken for count === 1 #819

@yocreoquesi

Description

@yocreoquesi

Source: multi-agent code audit 2026-06-10 (content/UI slice). Related to the already-fixed #729 (import dropped fr/it/ja).

1. Content toast: fr/it/ja exist in i18n.js but the inline STRINGS table ignores them

src/content/cleaner.js:106-143 keeps its own STRINGS table with only en/es/pt/de and SUPPORTED_LANGS = { en, es, pt, de }, while src/lib/i18n.js:531-535 ships all five toast keys for fr, it, ja. French/Italian/Japanese users always get the English toast — the translation effort exists and is discarded.

  • Extend the inline table with the fr/it/ja entries (or expose t() via window.__mugaCleaner so the content script stops maintaining a parallel table)
  • Drift guard: test asserting the inline STRINGS locales match i18n.js SUPPORTED_LANGS for the toast keys

2. Popup: renderCountCelebration destroys the animated span for the most common case

src/popup/popup.js:395-408 — for preview_count_one (no {n} placeholder), the code first builds the .preview-count-number span (lines 397-401), then line 404 el.textContent = template obliterates the children it just built. The CSS pulse animation never fires for "1 tracker removed". Final text is correct, so no test catches it.

  • Restructure the conditional so the span-building block and the plain-text branch are mutually exclusive
  • Extend tests/unit/popup-count-celebration.test.mjs:35-42 locale loop to include fr/it/ja (currently only en/es/pt/de are checked for the {n} placeholder)

Metadata

Metadata

Assignees

No one assigned

    Labels

    auditAction items from the 2026-05-12 multi-agent code auditaudit:uxAudit dimension: UX, copy, narrativebugSomething isn't workingpriority:P2P2 — Community & scale

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions