lookupLanguageTag
lookupLanguageTag(
available,ranges,options?):string|null
Defined in: packages/format-language-tag/src/match-language.ts:126
The single best available tag for a priority list of ranges, per RFC 4647 §3.4 Lookup.
Each range is truncated a subtag at a time until one of the truncations is an
available tag; the first range to produce one wins. A * subtag carries no
information a truncation could use, so it is dropped, and a range of nothing
but * is skipped rather than treated as matching everything — a caller that
wants a fallback says so with defaultTag.
Where two available tags differ only in case, the first one wins.
Parameters
Section titled “Parameters”available
Section titled “available”Iterable<string>
ranges
Section titled “ranges”Iterable<string>
options?
Section titled “options?”Returns
Section titled “Returns”string | null