CupThread React Native & Expo SDK - v0.1.0
    Preparing search index...

    Function resolveLocale

    • Resolves the effective locale for a CupThreadProvider-level locale input.

      Resolution order:

      1. An explicit locale tag other than 'auto' — used verbatim (e.g. 'ja', 'zh-Hans'), so an in-app language picker keeps working.
      2. 'auto' or omitted — the detected device locale from getDeviceLocale.
      3. 'en' when nothing is detectable.

      The returned tag is a raw locale identifier (not normalized to a dictionary key); feed it to getLocaleStrings, whose BCP 47 prefix matching already handles regional variants like pt-BR, zh-Hans-CN, or nb-NO.

      Parameters

      • Optionallocale: string

      Returns string