feat(web): localize relativeTime + migrate plural keys to CLDR _other#608
Merged
feat(web): localize relativeTime + migrate plural keys to CLDR _other#608
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small i18n hygiene fixes bundled because they share the same locale JSON files.
relativeTime()returned English-only literals (just now,Nm ago, …), bleeding English fragments into otherwise-localized KO prose. Route the 6 unit strings throught()with newtime.relative.*keys (12 new keys total across en/ko). Fixes the most-visible offender from PR feat(web): Index tab — upload disk usage panel for ~/.memtomem/uploads/ #599's uploads-usage panel (저장 위치 ~/.memtomem/uploads/ · 2개 파일 · 30 B · 가장 오래된 1m ago→… 1분 전) and every other call site downstream (timeline, sessions, scratch entries, search detail, sources, home)._one/_manysuffixes, but the CLDR convention is_one/_other. Rename both pairs (index.upload_usage_count_*,sources.memory_dirs.total_*) and update the two JS call sites (app.js,sources-memory-dirs.js).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) andsources-memory-dirs.js(v7→v8) since their bodies changed; locale JSON usescache: '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 passeduv run ruff check packages/memtomem/src && uv run ruff format --check packages/memtomem/src— cleangrep -rn '_many\b' packages/memtomem/src/memtomem/web/ packages/memtomem/tests/— no remaining i18n key matchesuv 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