[Bug]: App opens in the OS language instead of the configured UI language
Operating system
macOS
Orca version
v1.4.120-rc.3 (also reproducible from main at 3e4ace056)
Details
Short summary: Orca opens in the operating system language instead of the UI language previously configured in Settings → Appearance → Language.
What happened?
With the OS set to a non-English language (e.g. Spanish) and Orca's UI language explicitly set to English, relaunching Orca shows the UI in the OS language (Spanish), ignoring the persisted preference. The wrong language persists for the whole session — it is not just a startup flash.
How can we reproduce it?
- Set the OS display language to Spanish (or launch with a Spanish locale).
- In Orca, go to Settings → Appearance → Language and select English.
- Quit and relaunch Orca.
- The UI comes up in Spanish instead of the configured English.
Anything else that might help:
Root cause (from code inspection): in the renderer, I18nProvider (src/renderer/src/i18n/I18nProvider.tsx) reads state.settings?.uiLanguage ?? UI_LANGUAGE_SYSTEM. At startup settings is still null (it arrives async via the settings:get IPC round-trip from fetchSettings()), so the provider resolves 'system' → navigator.language and kicks off an async i18n.changeLanguage(<OS locale>) that lazily loads that catalog.
When the persisted settings arrive moments later, the effect re-runs with the configured locale, but the guard is if (i18n.language !== locale). Since the first changeLanguage is still in flight, i18n.language is still 'en' — so when the configured language is English, the guard is false and the correction is skipped. The in-flight OS-locale change then resolves and wins permanently. For non-English configured languages there is a similar race between two concurrent changeLanguage calls with no ordering guarantee.
Likely introduced by 16ce1aa73 (#6804), which made non-English catalog activation async/lazy. The main process is not affected — it reads the persisted value synchronously and awaits setMainUiLanguage before building menus (src/main/index.ts).
Also seeing this. I switched the UI language from System → English. The first time it seemed to apply, but after changing some other settings / working for a while, I looked again and it had reverted to System (the OS language) on its own — so the English preference doesn't stick across the session.