Skip to content

feat(web): localize relativeTime + migrate plural keys to CLDR _other#608

Merged
memtomem merged 1 commit intomainfrom
feat/i18n-relative-time-cldr-plurals
Apr 30, 2026
Merged

feat(web): localize relativeTime + migrate plural keys to CLDR _other#608
memtomem merged 1 commit intomainfrom
feat/i18n-relative-time-cldr-plurals

Conversation

@memtomem
Copy link
Copy Markdown
Owner

Summary

Two small i18n hygiene fixes bundled because they share the same locale JSON files.

No plural variants needed for the relative-time keys — the compact form has no plural distinction in either locale.

Cache-bust app.js (v77→v78) and sources-memory-dirs.js (v7→v8) since their bodies changed; locale JSON uses cache: 'no-store' so no versioning needed there.

Closes #600. Closes #601.

Test plan

  • uv run pytest packages/memtomem/tests/test_i18n.py -v — 12 passed (parity tests cover the 6 new keys and the 2 renames automatically)
  • uv run pytest -m "not ollama" -k "i18n or web" — 417 passed
  • uv run ruff check packages/memtomem/src && uv run ruff format --check packages/memtomem/src — clean
  • grep -rn '_many\b' packages/memtomem/src/memtomem/web/ packages/memtomem/tests/ — no remaining i18n key matches
  • Manual smoke (mode 1 — real config): uv run mm web → toggle EN/KO on Index tab uploads-usage panel and Sources tab Memory Dirs panel; verify no English fragments in KO prose, plural keys still resolve

🤖 Generated with Claude Code

Two i18n hygiene fixes bundled together because they touch the same
locale JSON files.

#600 — relativeTime() returned English-only literals (`just now`, `Nm
ago`, …), bleeding English fragments into otherwise-localized KO prose
(uploads-usage panel, timeline rows, sessions table, etc.). Route the
6 unit strings through t() with new `time.relative.*` keys so KO users
see `방금` / `1분 전` / `3시간 전` instead. No plural variants needed —
the compact form has no plural distinction in either locale.

#601 — Existing plural keys used `_one` / `_many` suffixes, but the
CLDR convention is `_one` / `_other`. Rename both pairs
(`index.upload_usage_count_*`, `sources.memory_dirs.total_*`) so a
future contributor reaching for `_other` lands on the existing
precedent instead of starting drift.

Cache-bust app.js (v77→v78) and sources-memory-dirs.js (v7→v8) since
their bodies changed; locale JSON uses `cache: 'no-store'` so no
versioning needed there. Closes #600. Closes #601.

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

Labels

None yet

Projects

None yet

2 participants