Skip to content

feat(web): complete i18n coverage for showConfirm/showToast strings#281

Merged
memtomem merged 1 commit intomainfrom
fix/29-i18n-coverage
Apr 19, 2026
Merged

feat(web): complete i18n coverage for showConfirm/showToast strings#281
memtomem merged 1 commit intomainfrom
fix/29-i18n-coverage

Conversation

@memtomem
Copy link
Copy Markdown
Owner

Summary

  • Routes the remaining hardcoded English strings in the web UI's showConfirm / showToast call sites through t(), completing the i18n coverage pass begun in commit 0c65e74.
  • Adds 46 new keys to both en.json and ko.json under common.*, confirm.*, and toast.*, matching the existing naming convention.
  • Adds a regression test suite that scans web static JS for hardcoded showToast(\...`)template literals, capitalized English string-literal toasts, and hardcodedtitle:values insideshowConfirm({})` blocks — the exact pattern web: i18n coverage for remaining hardcoded showConfirm/showToast strings #29 cleared.

Closes #29.

Scope

The issue referenced app.js line numbers that shifted after the JS module split (see memo feedback_js_module_split.md), so strings originally in app.js are now spread across several modules. This PR covers the full current location map:

File showConfirm sites fixed showToast sites fixed
app.js 4 + default confirmText 12 (+ 1 conditional msg)
settings-maintenance.js 3 (merge A/B, expire) 2 (expired, imported)
settings-namespaces.js 2 (rename, save-query)
settings-config.js 4 (rejected fields, applied count, re-index partial/complete)
settings-hooks-watchdog.js 2 (replace, sync) 4 (request-failed, unexpected-response, warnings, sync-failed)
context-gateway.js 7 (save/delete/sync/import/create-failed, detection-complete, name-required)

All interpolation uses the existing {param} syntax supported by i18n.js's t(key, params) helper — no change to the i18n runtime.

Test plan

  • uv run pytest packages/memtomem/tests/test_i18n.py — 11 pass (7 existing + 4 new regression guards)
  • uv run pytest packages/memtomem/tests -m "not ollama"1747 pass, 0 regression
  • uv run ruff check && uv run ruff format --check — green
  • node --check on each of the six JS files — all parse cleanly
  • Locale key parity: 516 per locale, placeholder-check passes

Follow-up

The existing settings.ctx.sync_success, settings.ctx.import_success, settings.hooks.sync_success call sites already route through t() with an English fallback and are unchanged here; the fallback only activates if the key is missing.

🤖 Generated with Claude Code

…loses #29)

Completes the i18n coverage pass begun in commit 0c65e74. Before this PR the
web UI still had hardcoded English in six modules (app.js was split in the
interim, so the work moved across several files):

- app.js                  — 4 showConfirm + 12 showToast + 1 bulk-delete msg + showConfirm default confirmText
- settings-maintenance.js — 3 showConfirm (merge A/B, expire) + 2 toasts (expired, imported)
- settings-namespaces.js  — 2 toasts (rename, save query)
- settings-config.js      — 4 toasts (rejected fields, applied count, reindex partial/complete)
- settings-hooks-watchdog.js — 2 showConfirm (replace, sync) + 4 toasts (request failed, unexpected response, warnings, sync failed)
- context-gateway.js      — 5 toasts (save/delete/sync/import/create failed) + detection-complete + name-required

46 new keys added to both en.json and ko.json under common.*, confirm.*, and
toast.*, matching the existing naming convention. All interpolations use the
{param} syntax already supported by i18n.js's t() helper.

Tests: adds four regression guards in tests/test_i18n.py — no template-literal
toast args, no English-capitalized literal toast args, no hardcoded English in
showConfirm titles, and a structural check that the #29 keys exist in both
locales. Existing locale parity + placeholder tests continue to pass (key
count now 516 per locale, up from 499).

Co-Authored-By: Claude <[email protected]>
@memtomem memtomem merged commit 2a41259 into main Apr 19, 2026
7 checks passed
@memtomem memtomem deleted the fix/29-i18n-coverage branch April 19, 2026 02:44
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 19, 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.

web: i18n coverage for remaining hardcoded showConfirm/showToast strings

2 participants