Skip to content

Releases: cplieger/langtag

v2.0.1

Choose a tag to compare

@github-actions github-actions released this 01 Sep 21:10
2ddf47a

Dependencies

  • Update dependency go to v1.27.1 (#52)

v2.0.0

Choose a tag to compare

@github-actions github-actions released this 20 Aug 23:28

Breaking changes

Carry comparison direction in a constructed Preference role

The module path moves to github.com/cplieger/langtag/v2.
The four positional directional functions - Compare(want, have),
Reason(want, have), Match(want, have, floor) and Best(want, ...) - are
replaced by a Preference constructed once from the wanted side
(langtag.Prefer(want) or c.Prefer(want)) and asked about offers:
p.Compare(have), p.Reason(have), p.Match(have, floor), and
Best(p, candidates, tagOf, floor) (a function because a method cannot
declare tagOf's type parameter as of Go 1.26). BestWith is folded into
Best via c.Prefer. Grading semantics are byte-identical; the direction
oracle tests pass unchanged. The zero Preference and a nil-*Comparer
Preference both fail CLOSED (TierNone everywhere) - a nil table judges
nothing acceptable rather than inheriting the widest table the package
ships. Preference gains Want() and String() for the build-once idiom;
Fallback documents its authoring-direction seam.

Make Best a method on Preference

The package-level Best function is gone. Call it on the
preference instead: langtag.Best(langtag.Prefer(want), candidates, tagOf,
floor) becomes langtag.Prefer(want).Best(candidates, tagOf, floor), and
c.Prefer(want).Best(...) for a custom table. Because Best is now a generic
method it cannot appear in an interface, so a caller abstracting over
selection wraps it in a non-generic method. v2 now requires the Go 1.27
toolchain. The v2 major is unreleased, so no published version carried the
old form.

Added

  • [breaking] Carry comparison direction in a constructed Preference role

Changed

  • Return the built-in tables through slices.Clone
  • [breaking] Make Best a method on Preference

Dependencies

  • Raise the go directive to Go 1.27.0

v1.0.5

Choose a tag to compare

@github-actions github-actions released this 19 Aug 15:54
e76d388

Dependencies

  • Update dependency go to v1.26.7 (#10)

v1.0.4

Choose a tag to compare

@github-actions github-actions released this 16 Aug 07:01
a92dc81

Fixed

  • Put Serbian's two scripts on the same-language tier

v1.0.3

Choose a tag to compare

@github-actions github-actions released this 16 Aug 00:38
a3a7e56

Fixed

  • Keep the farther tier when two entries claim one pair, and add Comparer.Match

v1.0.2

Choose a tag to compare

@github-actions github-actions released this 15 Aug 23:19
d1903b9

Fixed

  • Fail closed on a malformed fallback table and an unusable floor

v1.0.1

Choose a tag to compare

@github-actions github-actions released this 15 Aug 22:49
b0db5da

Fixed

  • Split cross-language fallbacks into intelligible and shared-literacy tiers

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 15 Aug 22:27
49e8980

Added

  • Tier-graded BCP 47 language tag matching