Optional tag: stringA language tag in any casing, with either - or _ separators.
Optional available: readonly string[]The solution's advertised tags - MPSolution.availableLanguages.
The matching entry from available, or undefined.
Generated using TypeDoc
Resolves a language tag to the exact tag a solution advertises, or
undefinedwhen 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 letszh_HansandZH-CNresolve the same way they do on iOS.The return value is the entry as
availablespells it, not as the caller spelled it, so the language reaches the backend with the casing the CMS published -zh-Hant, notzh-hant.Conservative about ambiguity by design: bare
zhagainst a solution advertising onlyzh-Hansandzh-Hantreturnsundefined. The iOS SDK's ownisLanguageAvailableis looser and would accept it, but Android'ssetLanguagerefuses, so a permissive answer here would be a lie on the platform that actually enforces it. A resolved tag is therefore safe to pass toMapsIndoors.setLanguageon both platforms; an unresolved one is not necessarily rejected.