Skip to main content

default_locale

Function default_locale 

Source
pub fn default_locale() -> String
Expand description

Resolve a default BCP-47 locale: the OS locale first (sys-locale already returns BCP-47, e.g. zh-Hant-TW), then the LANG environment variable (POSIX form zh_TW.UTF-8zh-TW), then en-US.

OS-first matters because this is also the serde default for AgentProfile.locale: under launchd there is no LANG, so the old LANG-only resolution silently defaulted every headless agent to en-US even on a non-English system.