feat(i18n): translate pages, components, stores and validators#103
Open
Nic-dorman wants to merge 4 commits into
Open
feat(i18n): translate pages, components, stores and validators#103Nic-dorman wants to merge 4 commits into
Nic-dorman wants to merge 4 commits into
Conversation
…seline) Plumbs vue-i18n@11 with tauri-plugin-os locale detection, a persisted i18n_locale config field, and a Settings → Language picker showing "System default: <OS-native name>" for the follow-system option. Extracts shell strings — sidebar nav, page titles, header connection pills, active transfers, Connect Wallet — to locales/en.json with a machine-translated locales/ja.json baseline. ja.json is flagged with _machine_translated: true; community polish to follow. Pages, components, toast strings, and validators are untouched — that sweep follows in a separate PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
vue-i18n's LocaleMessage type requires every value to be a string or
nested message object, so the boolean _machine_translated: true flag
failed nuxi typecheck:
Property '"_machine_translated"' is incompatible with index signature.
Type 'boolean' is not assignable to type 'LocaleMessageValue<…>'.
Rename to _translator_notes and put the same signal in a sentence —
satisfies the type system and reads more naturally for a contributor
who lands in ja.json from a PR.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sweeps every user-facing string from:
- pages/index.vue, files.vue, wallet.vue, settings.vue
- 5 file dialogs (CostEstimate, DatamapSaveAs, DownloadByDatamap,
Download, UploadConfirm)
- 4 node components (NodeTile, NodeDetail, NodeDetailPanel, AddNodeDialog)
- StatusBadge — statusMap refactored to use translation keys
Toast strings declared inline in these files are wrapped via t() at the
call site; standalone store-level toasts (stores/files.ts, stores/nodes.ts,
stores/updater.ts, stores/settings.ts) plus validator messages stay in
English here and follow in a separate commit.
Adds machine-translated Japanese (ja.json) for every new key.
Dynamic StatusBadge strings ("Uploading 45%", "Failed: <err>", "Quote: …")
pass through untranslated by design — the source emits them already-
formatted, so translating them requires the source to emit structured
tokens instead. Noted in StatusBadge comment for the follow-up.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sweeps the remaining store-level toast strings and validator messages: - stores/files.ts — upload/download complete + failed, payment failed, datamap missing / read failed toasts - stores/nodes.ts — add/start/stop/remove single + bulk toasts - stores/updater.ts — install no-restart + install failed toasts - utils/validators.ts — filenameError returns translation keys instead of literal strings; callers (DatamapSaveAsDialog, DownloadDialog) render via \$t(returnedKey) - components/UpdateDialog.vue — title, badge, progress + action labels Stores use options-API and can't call useI18n() (no setup context), so plugins/i18n.client.ts now exports the i18n instance. A small module-scope \`t()\` helper routes through \`i18n.global.t\` from each store. ja.json grows accordingly. No untranslated keys reachable through the UI in either locale (manual grep + DevTools console scan). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d1e1e0d to
7b3281c
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
StatusBadge,UpdateDialog, store-level toasts (files / nodes / updater) and filename validators.locales/ja.json.Stacked on #102
PR1 (framework + shell) must merge first. Once it does this rebases cleanly onto main with just the two sweep commits.
Notable refactors
plugins/i18n.client.tsnow exports thei18ninstance so options-API Pinia stores can calli18n.global.t(...)from outside a Vue setup context.utils/validators.ts::filenameErrornow returns translation keys instead of pre-translated English. Callers wrap with\$t(...)at render time.StatusBadge.vue'sstatusMapis keyed by backend status strings and resolves to translation keys at render time.Out of scope (intentional)
Uploading 45%,Failed: <err>,Quote: 0.001 ETH) pass throughStatusBadgeuntranslated. Translating these requires the source emitting structured tokens instead of pre-formatted strings — bigger refactor than this PR; noted in a comment inStatusBadge.vue.components/SettingsField.vueis unused (no callers) — not translated._machine_translated: trueinja.json. Community polish is the next phase.Test plan
🤖 Generated with Claude Code