You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
misc/language.rs: add full BCP 47 compliant pipeline
- Removes custom, incomplete language mapping tables
- Adds validation for the BCP 47-defined format
- Compares all components separately instead of treating them as the
same entity
- Adds canonicalization support for ISO 639-{1,2t,2b,3}
It is not overly strict in validation to preserve compatibility with
"custom" tags. If the language can be parsed and normalized, this will
be used; otherwise, it falls back to direct string comparison.
For BCP 47 components, all mismatches are penalized equally, with 1000
points deducted per mismatch. This value can be adjusted if needed.
This commit should greatly improve support for matching language tags
consisting of more than just the primary language and region.
0 commit comments