Localize dashboard settings section text and restore i18n lint coverage for those files. - Replace hardcoded settings section labels, help text, placeholders, and status copy with i18n lookups. - Add settings translation keys across supported app and common locale catalogs and refresh generated resource types. - Remove the settings sections from the i18n lint deferral list and document that coverage requirement. - Add a patch changeset for the published Fusion package. Files changed: .changeset/fn-6771-localize-settings-sections.md | 5 + docs/i18n-contributing.md | 3 +- i18next.config.ts | 26 +- .../settings/sections/AgentPermissionsSection.tsx | 55 +- .../settings/sections/AppearanceSection.tsx | 91 +- .../settings/sections/AuthenticationSection.tsx | 457 +++------- .../settings/sections/BackupsSection.tsx | 229 ++--- .../settings/sections/CommandsSection.tsx | 49 +- .../settings/sections/ExperimentalSection.tsx | 109 +-- .../settings/sections/GeneralSection.tsx | 487 ++++------- .../settings/sections/GlobalGeneralSection.tsx | 183 +--- .../settings/sections/GlobalModelsSection.tsx | 525 ++++------- .../components/settings/sections/MemorySection.tsx | 458 +++------- .../components/settings/sections/MergeSection.tsx | 863 ++++++------------ .../settings/sections/NodeRoutingSection.tsx | 108 +-- .../settings/sections/NodeSyncSection.tsx | 105 +-- .../settings/sections/NotificationsSection.tsx | 484 ++++------ .../settings/sections/PluginsSection.tsx | 105 +-- .../settings/sections/ProjectModelsSection.tsx | 971 ++++++++------------- .../components/settings/sections/RemoteSection.tsx | 560 +++++------- .../settings/sections/ResearchGlobalSection.tsx | 314 ++----- .../settings/sections/ResearchProjectSection.tsx | 226 ++--- .../settings/sections/RuntimesSections.tsx | 40 +- .../settings/sections/ScheduledEvalsSection.tsx | 169 ++-- .../settings/sections/SchedulingSection.tsx | 381 ++------ .../settings/sections/WorktreesSection.tsx | 330 ++----- packages/i18n/locales/en/app.json | 698 ++++++++++++++- packages/i18n/locales/en/common.json | 8 + packages/i18n/locales/es/app.json | 698 ++++++++++++++- packages/i18n/locales/es/common.json | 8 + packages/i18n/locales/fr/app.json | 698 ++++++++++++++- packages/i18n/locales/fr/common.json | 8 + packages/i18n/locales/ko/app.json | 698 ++++++++++++++- packages/i18n/locales/ko/common.json | 8 + packages/i18n/locales/zh-CN/app.json | 698 ++++++++++++++- packages/i18n/locales/zh-CN/common.json | 8 + packages/i18n/locales/zh-TW/app.json | 698 ++++++++++++++- packages/i18n/locales/zh-TW/common.json | 8 + packages/i18n/src/resources.d.ts | 706 ++++++++++++++- 39 files changed, 7178 insertions(+), 5097 deletions(-) Fusion-Task-Id: FN-6771 Fusion-Task-Lineage: cdf9b36f-414e-4084-b661-b578a4c27314
4.7 KiB
Localization (i18n) contributor guide
Fusion's UI is localized with react-i18next. English (en) is the
source-of-truth language; everything else is a translation of it. Both UI
surfaces — the React dashboard and the Ink terminal UI — share one set of
catalogs and config in the @fusion/i18n package.
Where things live
| Path | What it is |
|---|---|
packages/i18n/locales/{locale}/{namespace}.json |
Authored catalogs (translators edit here). en is the source. |
packages/i18n/src/config.ts |
Shared i18next config: namespaces, fallback chain, plural setup. |
packages/core (SUPPORTED_LOCALES, Locale) |
The single list of supported locale codes. |
i18next.config.ts (repo root) |
i18next-cli workflow config. |
Namespaces: common (shared), app (dashboard-only), errors, and cli
(terminal-only). The dashboard loads common/app/errors; the CLI loads
common/cli/errors.
The workflow
All commands run from the repo root:
pnpm i18n:extract # pull t()/<Trans> keys from source into the en catalogs
pnpm i18n:sync # propagate the en key structure to every other locale
pnpm i18n:types # regenerate key types from the en catalogs
pnpm i18n:status # key-parity gate: structure only, empty values allowed
pnpm i18n:status:report # upstream completeness report (informational; may exit non-zero)
pnpm i18n:lint # flag hardcoded user-facing strings
pnpm i18n:gen-cli # regenerate the CLI static catalog import map
pnpm i18n:status must be green before landing catalog or extraction changes,
but it only verifies that every secondary catalog has the same structural keys as
en. Empty secondary-locale values ("") are expected placeholders and do not
fail the gate because runtime falls back to English. Use
pnpm i18n:status:report when you want the upstream completeness report that
counts empty placeholders as untranslated; that report is informational and may
exit non-zero until translations are filled.
Lint baseline policy
pnpm i18n:lint is the hardcoded user-facing string guardrail and must stay
green. Its file scope intentionally matches extraction: tests and stories are
excluded because they are non-shipping fixtures and extract already ignores
them. Suppress non-translatable token categories with narrow
lint.ignoredTags / lint.ignoredAttributes entries, such as keyboard-key
content in <kbd>, instead of hiding source directories.
Any remaining user-facing copy must be localized with t() / <Trans> and an
en catalog entry. A temporary deferral is only acceptable when it is scoped to
specific files or a small cluster in lint.ignore, includes an FNXC rationale,
and has a filed follow-up task that removes the ignore. The settings sections
cluster is no longer deferred as of FN-6771; keep those files covered by lint.
Translating an existing language
- Run
pnpm i18n:syncso every catalog has the currentenkeys (untranslated entries are empty strings). - Fill the empty strings in
packages/i18n/locales/{locale}/*.json. - Keep interpolation placeholders verbatim:
{{brand}},{{detail}},{{key}}. Never translate a[{{key}}]keybinding accelerator — only the words around it. - Run
pnpm i18n:statusto confirm key parity still holds, then optionally runpnpm i18n:status:reportto inspect remaining untranslated placeholders.
zh-CN and zh-TW are independent — different script and vocabulary. Do
not machine-convert one into the other.
Adding a new language (near-zero code)
- Add the locale code to
SUPPORTED_LOCALESinpackages/core/src/types.tsand tolocalesini18next.config.ts. pnpm i18n:sync— scaffolds a full set of catalog files for the new locale with the correct plural categories.pnpm i18n:gen-cli— adds the locale to the CLI's static import map.- Run
pnpm i18n:statusto verify the new locale has the same key structure asen. Translate the new catalogs as time allows, usingpnpm i18n:status:reportas the informational completeness report.
No feature code changes are required: the dashboard discovers the locale through
the generated app/locales/ tree, and the CLI through the regenerated import
map. Add the language's endonym to ENDONYMS in
packages/dashboard/app/components/LanguageSelector.tsx so it appears in the
Settings switcher.
Using a non-English locale
-
Dashboard / mobile: Settings → Appearance → Language. The choice persists to
localStorageand to server settings. -
Terminal UI: resolved from
--lang <code>→ the saved dashboard language setting → theLC_ALL/LC_MESSAGES/LANG/LANGUAGEenvironment →en.fusion dashboard --lang zh-TW