Skip to main content

common_locale_data 3.0.0 copy "common_locale_data: ^3.0.0" to clipboard
common_locale_data: ^3.0.0 copied to clipboard

A type-safe and tree-shakable API to access translated common data (measurement units, date fields, country names etc...)

3.0.0 #

  • Code lookups (cld.languages['es'], and the same on territories, scripts, variants, currencies, subdivisions and timeZones) are extension operators (LanguagesLookup, TerritoriesLookup etc...) instead of instance members. dart2js keeps an instance operator [] as soon as any [] in a program has an untyped receiver, such as decoded JSON or intl's date symbols, so every web build carried the language canonicalization rules (about 300 KB of JavaScript), the time zone data and each instantiated container's map, even without a lookup. Typed calls compile unchanged (breaking change):
    • a lookup through dynamic no longer resolves
    • a subclass can no longer override a lookup or call super[...]
    • a library that imports package:common_locale_data/src/... instead of a public library must import the public library to see the extensions

2.4.0 #

  • Add list patterns (cld.listPatterns): join a list of items into a localized text such as "A, B, and C" (standard), "A, B, or C" (or) or "3 ft 7 in" (unit), each in long/short/narrow widths. Includes the same Spanish ("y" → "e", "o" → "u") and Hebrew ("ו" → "ו-") rules as ICU

2.3.0 #

  • Add a high-level relative time ("timeago") formatter (cld.relativeTime): formats a DateTime/Duration as e.g. "3 minutes ago", "in 2 days", "yesterday" or "last week". It is calendar-aware (day/month/year compared by calendar field), can render weekday names ("last Tuesday"), exposes a low-level formatUnit(offset, unit) API and minUnit/maxUnit clamping, and supports long/short/narrow widths
  • Add week conventions (cld.weekInfo): first day of the week, weekend days and minDaysInFirstWeek, with an isWeekend() helper

2.2.1 #

  • Minor fix to LICENSE and README.md files

2.2.0 #

  • Implemented inheritance for language specific locales to reduce source code and binary file sizes

2.1.0 #

  • Include support for LocaleId's and printing of all fields (currency, script, variants, subdivisions)
  • Add support for currency and subdivisions CLDR data
  • Improved compile times, resulting file size etc. by changing maps from CanonicalizedMap to const {}, etc.
  • NOTE: Lookups via the operator [] are still case-insensitive, however direct access to the languages.languages, territories.territories etc. members become case sensitive.
  • Added non-countries to territories map
  • Added static access members for languages, territories, scripts, variants and currencies.

2.0.0 #

  • Include all locales that are available from CLDR
  • Change the imports to improve compile times when only a limited number of locales is used (breaking change)
  • Add support for Timezones
  • Improved documentation
  • Update to CLDR 46

1.2.0 #

  • Added timezone data
  • Improved documentation
  • General code improvements
  • Removed cld global variable
  • More flexible locale inclusion during generation
  • Improved compile time by not by default importing/exporting all locales
  • Add all locales available in CLDR

1.1.0 #

  • Update to latest data of CLDR

1.0.1 #

  • Add some API documentation

1.0.0 #

  • Initial version
2
likes
160
points
7.53k
downloads

Documentation

API reference

Publisher

verified publisherxaha.dev

Weekly Downloads

A type-safe and tree-shakable API to access translated common data (measurement units, date fields, country names etc...)

Repository (GitHub)
View/report issues

Topics

#i18n #locale #unicode #translation #timezone

License

Unicode-3.0, MIT (license)

Dependencies

collection, intl

More

Packages that depend on common_locale_data