Skip to content

Releases: rspeer/langcodes

Version 3.3

11 Oct 14:51
Compare
Choose a tag to compare

Version 3.3 (November 2021)

  • Updated to CLDR v40.

  • Updated the IANA subtag registry to version 2021-08-06.

  • Bug fix: recognize script codes that appear in the IANA registry even if
    they're missing from CLDR for some reason. 'cu-Cyrs' is valid, for example.

  • Switched the build system from setuptools to poetry.

v3.2.1

05 Oct 18:29
Compare
Choose a tag to compare

Corrected cases where the parser accepted ill-formed language tags:

  • All subtags must be made of between 1 and 8 alphanumeric ASCII characters
  • Tags with two extension 'singletons' in a row (en-a-b-ccc) should be rejected

v3.2.0

04 Oct 23:37
Compare
Choose a tag to compare
  • 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.