A raw BCP 47 tag from the first available source, or null when
nothing is detectable (e.g. plain Node tooling) — callers fall back to 'en'.
Sources are consulted in order:
expo-localization — ubiquitous in Expo apps and reflects per-app
language overrides.react-native-localize — the common choice in bare React Native apps.SettingsManager on iOS, I18nManager on Android,
navigator.language on web.Both localization packages are optional: the requires below use the same
runtime-require pattern as getRuntimePlatform() so plain-Node tooling
keeps working, and Metro's default allowOptionalDependencies treats the
try/catch-wrapped requires as optional instead of failing the bundle when
the package is absent. The built-in result is memoized — the device locale
is stable within a session — and can be cleared with
resetDeviceLocaleCache.
Reads the device locale for
'auto'locale resolution.