Picks the first supported locale a client's candidates select.
Each candidate is canonicalized (a malformed one is skipped), matched
exactly, then with subtags stripped right-to-left (de-Latn-AT →
de-Latn → de). Intl.Locale.minimize is deliberately not used: it
leaves de-AT as de-AT. A * candidate selects the first supported
locale that no excluded range covers; exclusion applies to * only.
Parameters
candidates: readonlystring[]
Client preferences, highest first
supported: readonlystring[]
The application's supported tags, default first
excluded: readonlystring[] = []
Ranges the client marked q=0
Returns string|undefined
The matched supported tag, or undefined when nothing matched
Picks the first supported locale a client's candidates select.
Each candidate is canonicalized (a malformed one is skipped), matched exactly, then with subtags stripped right-to-left (
de-Latn-AT→de-Latn→de).Intl.Locale.minimizeis deliberately not used: it leavesde-ATasde-AT. A*candidate selects the first supported locale that noexcludedrange covers; exclusion applies to*only.