Skip to content

i18n: translate popup home view strings#336

Open
pooyak wants to merge 1 commit into
hangwin:masterfrom
pooyak:feat/popup-i18n
Open

i18n: translate popup home view strings#336
pooyak wants to merge 1 commit into
hangwin:masterfrom
pooyak:feat/popup-i18n

Conversation

@pooyak
Copy link
Copy Markdown

@pooyak pooyak commented Apr 28, 2026

Summary

The popup home view had inline Chinese strings in entrypoints/popup/App.vue (template + a few script callsites), so the popup rendered in Chinese for users whose browser UI locale resolves to anything other than zh_CN, even though _locales/en/messages.json already exists and most of the same view is already wired through getMessage().

This PR threads the remaining popup strings through the existing i18n pipeline. No new infrastructure — just replaces hardcoded text with getMessage() calls and registers the keys.

Changes

  • entrypoints/popup/App.vue
    • Section titles: Quick Tools, Management
    • Quick-tools tooltips (3): record/stop "coming soon", page-edit, element-marker
    • Management entries (4 × title + desc): AI Assistant, Workflow Management, Element Marker Management, Local Model
    • Coming-soon toast: template now uses comingSoonMessage with $FEATURE$ placeholder; the three callers (startRecording, stopRecording, openWorkflowSidepanel) pass localized feature names instead of literal Chinese strings
  • _locales/en/messages.json, _locales/zh_CN/messages.json — 15 new keys (descriptions included)
  • utils/i18n.ts — corresponding English entries in the fallbackMessages map

Scope

Intentionally limited to entrypoints/popup/App.vue. Sibling components (LocalModelPage.vue, ScheduleDialog.vue, sidepanel, builder, web-editor-v2) still have inline Chinese and can follow in separate PRs to keep this diff reviewable.

Test plan

  • prettier --check — clean
  • eslint — clean
  • JSON validation — both messages.json files parse
  • vue-tsc --noEmit — no new errors introduced (one pre-existing TS2322 on L287 @switch-model exists on master and is unrelated)
  • Manual verification: load the unpacked extension with browser locale = en, confirm popup home view renders English (Quick Tools / Management / AI Assistant / etc.) and the coming-soon toast substitutes the feature name correctly.

🤖 Generated with Claude Code

The popup home view had inline Chinese strings in the Vue template
and a few script callsites, so the popup rendered in Chinese for users
whose browser locale resolved to en (or anything other than zh_CN)
even though _locales/en already existed and the rest of the home view
was already wired through getMessage().

Replace the hardcoded text with getMessage() calls and add the
matching keys to _locales/en, _locales/zh_CN, and the fallback map
in utils/i18n.ts. Touched strings:

- Section titles: Quick Tools, Management
- Quick-tools tooltips: recording-coming-soon, page-edit, element-marker
- Management entries: AI Assistant, Workflow Management, Element Marker
  Management, Local Model (titles + descriptions)
- Coming-soon toast template (now placeholder-substituted with the
  feature name) and the two recording-flow callers + workflow caller
  that previously passed Chinese feature names directly.

Scope is limited to entrypoints/popup/App.vue. Sibling components
(LocalModelPage, ScheduleDialog, sidepanel, builder, web-editor) still
contain inline Chinese; those are left for follow-up PRs to keep this
diff reviewable.
@pooyak
Copy link
Copy Markdown
Author

pooyak commented Apr 28, 2026

Confirmed it renders correctly in English now:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant