Skip to content

feat(web): wire up missing data-i18n on Export, Tags sort, Auto-Tag, Timeline#695

Merged
memtomem merged 1 commit intomainfrom
feat/web-i18n-missing-labels
May 2, 2026
Merged

feat(web): wire up missing data-i18n on Export, Tags sort, Auto-Tag, Timeline#695
memtomem merged 1 commit intomainfrom
feat/web-i18n-missing-labels

Conversation

@memtomem
Copy link
Copy Markdown
Owner

@memtomem memtomem commented May 2, 2026

Summary

  • Wire data-i18n (and data-i18n-placeholder where relevant) onto Export filters, Import bundle/result rows, Tags sort buttons, Auto-Tag form/result, and Timeline date-range/filter labels.
  • All target keys already exist in both en.json and ko.json — this PR adds zero locale entries.

Why

These surfaces had hardcoded English in index.html despite matching keys living in locales/. In Korean mode users saw mixed English/Korean labels (Source Filter, Today, Last 7 days, Count↓, Dry run, Limit, etc.) which made the language toggle feel half-finished.

What changed

Section Wired up
Export filters Source Filter, Tag Filter, Since (ISO date), Namespace, All Namespaces, Preview, Download JSON, three matching placeholders
Import card Bundle File (.json), four result-row labels (Total chunks, Imported, Skipped, Failed)
Tags sort Count↓, Count↑, A-Z, Z-A
Auto-Tag form Source Filter, Max Tags per Chunk, Overwrite existing, Dry run, three matching placeholders
Auto-Tag result Total chunks, Tagged, Skipped
Timeline date select Today, Last 7/30/90/180/365 days, Custom…
Timeline filters Source filter, Namespace, Limit, All, source placeholder

Notes on checkbox labels

For two checkbox controls (Overwrite existing, Dry run) the text was a bare child of a <label> that also contained the <input type="checkbox">. Putting data-i18n on the <label> would have wiped the checkbox out via applyDOM's textContent write. Wrapping the text in a sibling <span data-i18n="..."> keeps the checkbox intact and follows the pattern already used elsewhere in the file (e.g. the Timeline <label> wrappers).

Test plan

  • uv run pytest packages/memtomem/tests/test_i18n.py -q — 12 passed (parity guard).
  • uv run ruff check packages/memtomem/src && uv run ruff format --check packages/memtomem/src clean.
  • Manual: load mm web, toggle to Korean, walk Export/Tags/Timeline sections and confirm all wired-up labels switch to Korean and back to English.

🤖 Generated with Claude Code

…line labels

These surfaces had hardcoded English strings in ``index.html`` even though
matching translation keys already existed in ``locales/en.json`` and
``locales/ko.json``. As a result, the Korean UI displayed mixed English/Korean
labels — Source Filter, Tag Filter, Since (ISO date), Preview, Download JSON,
Count↓, A-Z, Max Tags per Chunk, Overwrite existing, Dry run, Today,
Last N days, Source filter, Namespace, Limit — all stayed in English.

Wire ``data-i18n`` (and ``data-i18n-placeholder`` where relevant) onto the
existing labels, options, buttons, and table cells so ``I18N.applyDOM`` can
swap them on language change. For two checkbox labels (``Overwrite existing``,
``Dry run``) the text was a bare child of a ``<label>`` housing an ``<input>``;
``data-i18n`` on the label would clobber the checkbox via ``textContent``,
so the text is moved into a sibling ``<span>``.

No new keys are added — all targets already exist in both locales. Parity
test (``test_i18n.py``) still passes.

Co-Authored-By: Claude <[email protected]>
@memtomem memtomem merged commit 34149ae into main May 2, 2026
8 of 9 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants