Files
client/docs/i18n.md
T

5.5 KiB
Raw Blame History

Localization

TeamsPeach defaults to English, independently of the operating-system language. Settings → Appearance → Language selects English or Russian. The native preference is persisted by the Rust preferences service; catalog presentation belongs to the UI, not the protocol or capture worker.

Native files and boundaries

  • native/resources/i18n/en.json: bundled English source catalog.
  • native/resources/i18n/ru.json: bundled Russian catalog.
  • native/src/ui/i18n.rs: Language, Catalog, named substitution, number presentation and plural selection.
  • native/src/services/prefs.rs: validated persisted preferences.
  • native/src/app/runtime/: ordered settings intents, persistence and authoritative snapshots.
  • native/src/ui/ and native/ui/: Rust projections and Slint presentation.

The catalogs are compiled into the application. There is no translation service, remote catalog fetch, browser formatter, DOM translation pass or translation IPC endpoint. Technical diagnostics stay English. A locale change must not replace an identity, connection, media session, audio route or unrelated preference.

Using messages

Use Catalog::new(Language::En) or the current snapshot's catalog, then text(key) for a complete message and format(key, &[("name", value)]) for named parameters. Catalog::number formats display numbers; UIDs, versions, device identifiers, URLs and user data stay exact strings. Use complete sentences instead of concatenating translated fragments.

The formatter performs one substitution pass: inserted content containing braces is not interpreted as another template. Plural messages use language-specific categories and other; Russian integer suffixes are not English suffix rules. Fractions use other. Catalog key and placeholder parity remain required. The native formatter's English/key fallback and retained unresolved placeholders are not evidence that missing translations are acceptable: missing keys/parameters need authoring coverage and must never be mistaken for success.

Bind Slint text, accessibility names, tooltips and placeholders from the current catalog/model. Dynamic messages must be regenerated from stable keys and raw values when language changes, not translated by matching previously painted wording. Avoid rebuilding forms in ways that discard unsaved input, selection, undo state or focus.

Language changes never translate server/channel names, nicknames, OS device names, chat content, media or descriptions. App-created notices are localized separately from incoming data. Error explanations are selected by stable machine code, with verbatim server/OS/backend detail after the explanation where useful. Unknown codes remain visible errors. Native chooser titles, filters and application-owned confirmation labels use the current saved language; OS-owned controls follow the OS language.

Adding a language

  1. Add a bundled JSON catalog beside the existing catalogs, preserving keys and named placeholders.
  2. Extend Language, catalog loading, plural/number presentation, the validated preference and Appearance choices together.
  3. Supply appropriate plural rules; do not copy English suffix rules.
  4. Keep source comments, logs, diagnostics, documentation and tests English. Localized authored wording belongs in catalogs; genuine external Unicode data stays exact.
  5. Add native behavioral coverage for catalog parity, substitution, unknown keys, missing arguments, numbers, plural cases 1/2/5/11/21 and fractions, and raw-content preservation.
  6. Exercise a disposable native profile across all settings categories, context menus, tooltips, errors and minimum-window layouts. Observe the saved language after a full restart and confirm unrelated state/drafts are unchanged.

Acceptance and recorded evidence

native/src/ui/i18n.rs contains native formatter tests. xtask smoke with the offline-ui scenario drives the actual Slint application with isolated state; README documents the Cargo interface. A scenario's existence is not a pass, and disconnected checks do not establish active call/stream continuity.

The native report target/evidence/native-offline-ui-03/result.json records EN/RU, dark/light and 390/800/1280 logical-pixel settings coverage, controlled combobox values and profile restarts. See FEATURE_COMPATIBILITY.md for the complete scope and limitations. No additional execution is claimed by this documentation update.

Historical development runs, 2026-10-24

The removed browser implementation passed 14 targeted localization tests and its Windows x64 hidden-runtime scenario on Electron 44.9.3. Evidence is retained in docs/evidence/runtime/i18n-2026-10-24/: fresh English, seven categories and both real-device context menus in both languages, live notice translation, Russian persistence, return to English, no capture, unchanged UID/nickname/audio/unrelated preferences, preserved connection draft, and no horizontal overflow at 880×560. Temporary profiles were deleted. This is historical evidence, not a native pass.

The historical 0.1.4 voice-activation localization check is in docs/evidence/runtime/2026-10-24-vad-i18n/. It used a fresh 880×560 profile without a connection or capture and observed all sensitivity choices in persisted preferences. The retained requirements distinguish local speech detection from meters, recording and recognition; explain the approximate 0.4-second tail; and avoid promising suppression of television, other voices or all noise. Native independent DSP is not claimed identical to the official client's private processing.