Save first, show the native restart confirmation only on success, and dispatch the existing relaunch route only on confirmation. Keep the startup catalog active until the next launch and verify cancel, policy-denied confirmation, failed save, and separate-process restore.
7.1 KiB
Localization
TeamsPeach defaults to English, independently of the operating-system language. Settings → Appearance → Language saves English or Russian as the language for the next launch. The picker shows the saved value immediately; the running catalog changes only when the app starts again. On desktop, a successful change away from the running language offers a restart. Cancel dismisses the prompt without undoing the save, and the warning remains under the picker. A failed save keeps the previous value and does not open a prompt. Mobile uses the saved language at the next launch without a desktop relaunch prompt.
The manifest-pinned TeamSpeak 6.0.0.5232 main.js initializes its catalog from navigator.language (character offsets 1424854 and 1445824). Its Appearance setter saves via application.language, then offers a restart only when the selection differs from the running language (4597988). The Cancel callback does not write the preference. These observations come from the pinned bundle, not a live TeamSpeak relaunch.
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/andnative/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 running catalog/model. The settings selection displays the stored language while the rest of the application continues using its startup catalog. 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 running language; OS-owned controls follow the OS language.
Adding a language
- Add a bundled JSON catalog beside the existing catalogs, preserving keys and named placeholders.
- Extend
Language, catalog loading, plural/number presentation, the validated preference and Appearance choices together. - Supply appropriate plural rules; do not copy English suffix rules.
- Keep source comments, logs, diagnostics, documentation and tests English. Localized authored wording belongs in catalogs; genuine external Unicode data stays exact.
- 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.
- 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.
The focused Windows Slint test language_applies_and_survives_process_restart clicks real dropdown options at 900×800 (English to Russian in dark mode and Russian to English in light mode). It checks that only language changes on disk, the selected caption changes before the restart prompt is answered, and the surrounding labels remain in the running language. Cancel keeps the saved choice. Confirm reaches the desktop relaunch policy gate, which refuses OS actions in the smoke runtime. A separate process opens the same disposable profile and renders the saved language; a blocked reverse write returns io with no prompt and preserves the selector, active catalog and exact preference bytes. The test does not spawn a production replacement process or establish live voice/chat continuity. Native uses the shared confirmation dialog, not the reference’s anchored popup geometry.
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.