Skip to content

i18n: promote "Load All" button label to chunks.load_all locale key #681

@memtomem

Description

@memtomem

Context

The "Load All" button rendered in the source chunk browser is currently
hard-coded English:

// packages/memtomem/src/memtomem/web/static/app.js:3091
loadAllBtn.textContent = 'Load All';

The KO locale shows Load All in English alongside otherwise-localized
UI. Discovered while reviewing PR #678 (Timeline → Source jump
follow-ups) — the new toast.chunk_target_missing originally said "try
Load All" in both locales, which was a tell that the button itself
wasn't going through t().

Same i18n surface as PR #29 (chunks.* / common.* / toast.* keys) and
PR #587 (langchange follow-through).

What we want

Promote 'Load All' to a locale key — e.g. chunks.load_all
following the existing patterns:

const loadAllLabel = (typeof t === 'function')
  ? t('chunks.load_all') : 'Load All';
loadAllBtn.textContent = loadAllLabel;
loadAllBtn.setAttribute('data-i18n', 'chunks.load_all');

data-i18n is required for the langchange hook (feedback_data_i18n_ nested_children.md, i18n.js applyDOM()) to keep the label in sync
when the user toggles KO/EN at runtime.

Files

  • packages/memtomem/src/memtomem/web/static/app.js (line 3091)
  • packages/memtomem/src/memtomem/web/static/locales/en.json
    — add chunks.load_all: "Load All"
  • packages/memtomem/src/memtomem/web/static/locales/ko.json
    — add chunks.load_all: "전체 불러오기" (or similar)

Acceptance criteria

  • app.js?v= cache-bust bumped (per feedback_static_asset_cache_ bust.md).
  • test_i18n.py parity passes (en + ko have the new key).
  • KO locale shows the translated label on first paint and after a
    langchange toggle.
  • No regression on Source tab chunk browser (button still wires to
    browseSource(path, 500)).

Difficulty

Good first issue: ≤ 3 files (app.js + 2 locales), no API break,
piggyback-eligible if any other small i18n cleanup ships in the same
window.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions