Skip to content

Function: resolveEnvLocale() ​

resolveEnvLocale(env, roster?): string

Resolve an app's locale from the platform env: ui_locale (the locale picked in the Pitcher shell, web only), falling back to device_locale (the iOS device locale). Both are TOP-LEVEL env keys, siblings of pitcher. NEVER env.pitcher.user.language: that field is dead (PIT-7554).

An exact match wins, then the base language, then en. Web sends the shell's picked locale (pt-BR resolves to pt-br); iOS sends the base code, except pt-br for Brazilian Portuguese.

Parameters ​

ParameterTypeDefault valueDescription
env{ device_locale?: string; ui_locale?: string; } | undefinedundefined-
rosterreadonly string[]supportedEnvLocalesthe locales the app bundles; defaults to supportedEnvLocales.

Returns ​

string