Skip to content

v3.2.0

Compare
Choose a tag to compare
@rspeer rspeer released this 04 Oct 23:37
· 43 commits to master since this release
  • Added the top-level function tag_is_valid(tag), for determining if a string
    is a valid language tag without having to parse it first.

  • Added the top-level function closest_supported_match(desired, supported),
    which is similar to closest_match but with a simpler return value. It
    returns the language tag of the closest match, or None if no match is close
    enough.

  • Bug fix: a lot of well-formed but invalid language codes appeared to be
    valid, such as 'aaj' or 'en-Latnx', because the regex could match a prefix of
    a subtag. The validity regex is now required to match completely.

  • Bug fixes that address some edge cases of validity:

    • A language tag that is entirely private use, like 'x-private', is valid
    • A language tag that uses the same extension twice, like 'en-a-bbb-a-ccc', is invalid
    • A language tag that uses the same variant twice, like 'de-1901-1901', is invalid
    • A language tag with two extlangs, like 'sgn-ase-bfi', is invalid
  • Updated dependencies so they are compatible with Python 3.10.