Skip to main content

locale_or_default

Function locale_or_default 

Source
fn locale_or_default(raw: Option<String>) -> String
Expand description

Normalise an optional OS locale into a BCP-47 tag the renderer can hand to Intl. Falls back to "en-US" when the OS reports nothing usable. Pure so the fallback is unit-testable without the platform locale source.