pysepal.solara.locale.match_offered_locale#
- pysepal.solara.locale.match_offered_locale(candidate, offered)[source]#
Return the code from
offeredthat best matchescandidate.Order: exact match, bare primary subtag if offered, then the first offered variant sharing the primary subtag.
navigator.languagereportses-CLwhere an app shipses, and a catalog may shippt-BRwhere the browser reportspt; both must resolve rather than fall through to English.- Parameters:
candidate (str) – The code to match, in IETF BCP 47.
offered (Iterable[str]) – The codes to match against, in preference order.
- Returns:
The matching code, or
""so callers can try their next source.- Return type:
str