Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
02. i18n (English-first)
1. Policy
PI-Desktop is a global product.
- Default locale:
en - Source language: English
- Authoring language for specs/UI/source strings: English
- Other locales are translations of English sources
2. Framework requirements
UI must use i18next + react-i18next (D012).
Rules:
- No hard-coded user-facing English sentences scattered without IDs long-term
- Every visible string has a stable key
- Locale switch must not require code edits
- Every shipped locale has the same flattened key set as English
- Interpolation variable names and sets match across every locale
- Dates and times use the active application locale rather than the host default
- Electron application-menu custom labels and renderer window controls consume catalog keys; native role labels may use Electron/OS localization
Canonical thinking-level values are an intentional exception to the visible
string rule: Composer, model-configuration, and delegation surfaces render
the protocol values off, minimal, low, medium, high, xhigh, and
max directly. These stable technical values must not be added to locale
catalogs or translated.
3. Catalog structure
packages/i18n/src/locales/
├── en/index.ts
├── zh-CN/index.ts
├── zh-TW/index.ts
├── tr/index.ts
├── de/index.ts
├── es/index.ts
├── fr/index.ts
├── ko/index.ts
└── pt-BR/index.ts
The English catalog is the source type for translated catalogs. A registry in
packages/i18n lists every shipped locale (id, native name, English name).
Catalog parity and interpolation parity are enforced across every shipped
locale by automated tests. Adding a locale is a catalog file plus a registry
row; the language picker reads that registry.
4. Key conventions
domain.section.item
Examples:
chat.composer.placeholdersettings.providers.addplugins.permissions.fs.writeerrors.tool.deniedcomposer.mode.agentcomposer.mode.planplan.approval.titleplan.approval.artifactPathplan.approval.openArtifactplan.approval.approveplan.approval.rejectplan.approval.permissionAutoWarningsettings.shell.defaultsettings.shell.unavailableerrors.COMMAND_SHELL_CHANGEDerrors.COMMAND_SHELL_INVALIDerrors.SHELL_NOT_FOUNDerrors.PLAN_ARTIFACT_WRITE_FAILEDerrors.PLAN_EXECUTION_INTERRUPTEDerrors.PLAN_REQUIRES_INTERACTIVE_SESSION
5. Non-UI language surfaces
Also English-first:
- docs/spec
- ADRs
- commit messages
- issue/PR templates
- plugin example docs
- command titles in core product
Plugin identity (manifest.i18n) is host-resolved (ADR 0267). Plugin-owned UI
localizes from the host locale (pi.app.getLocale, ADR 0280). English remains
required for flat identity fields.
6. Acceptance
- App boots in English by default
- Locale files exist for English source catalog
- Switching architecture supports additional locales
- No Chinese hard dependency in core UI path
- Catalog tests reject missing keys or mismatched interpolation variables
- Import, Projects, and Temporary sessions expose localized visible and accessible labels in every shipped locale
- macOS system-menu custom commands and Windows/Linux window controls expose localized labels in every shipped locale
- Boot splash and renderer crash chrome use catalog keys (
app.starting,app.shellName,app.tagline,app.uiCrashed); project, temporary-session, and no-session empty-home hero titles/subtitles are translated in every shipped locale - User-visible catalog copy prefers plain product language over internal
engineering terms (
host/backend/repo refresh/workspacewhere the UI already says project). Status, empty states, errors, and setup hints explain what happened and what to do next (D149) - Agent/Plan/Goal selector, contract states, title/artifact-opener/ remembered approval-mode actions, Bash/Auto mutation warning, shell catalog/unavailable state, fail-closed recovery, and shared Plan/Goal error codes have matching keys in every shipped locale; no Chat operating-mode key or command is shipped