• Resolves a language tag to the exact tag a solution advertises, or undefined when nothing in the fallback chain matches.

    Port of Android's MPLanguageManager.canonicalLanguage: an exact case-insensitive match first, then an RFC 4647 "lookup" walk that strips subtags right to left, with the Chinese region-to-script enrichment tried ahead of the raw tag. The canonical form from normalizeLanguageTag is tried first of all, which is what lets zh_Hans and ZH-CN resolve the same way they do on iOS.

    The return value is the entry as available spells it, not as the caller spelled it, so the language reaches the backend with the casing the CMS published - zh-Hant, not zh-hant.

    Conservative about ambiguity by design: bare zh against a solution advertising only zh-Hans and zh-Hant returns undefined. The iOS SDK's own isLanguageAvailable is looser and would accept it, but Android's setLanguage refuses, so a permissive answer here would be a lie on the platform that actually enforces it. A resolved tag is therefore safe to pass to MapsIndoors.setLanguage on both platforms; an unresolved one is not necessarily rejected.

    Parameters

    • Optional tag: string

      A language tag in any casing, with either - or _ separators.

    • Optional available: readonly string[]

      The solution's advertised tags - MPSolution.availableLanguages.

    Returns string | undefined

    The matching entry from available, or undefined.

    Export

Generated using TypeDoc