Skip to content

Unicode CLDR data and Lua interface

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE-Unicode
Notifications You must be signed in to change notification settings

alerque/cldr-lua

Repository files navigation

CLDR Lua

Luacheck Busted Coverage Status GitHub tag (latest SemVer) LuaRocks

Unicode CLDR (Common Locale Data Repository) data and Lua interface.

What is CLDR?

From the CLDR website:

The Unicode CLDR provides key building blocks for software to support the world's languages, with the largest and most extensive standard repository of locale data available.

What does this data set include?

For now, data and interfaces will be added on an as-needed basis. Here is a basic rundown of the data available upstream vs. what this library currently provides.

All included data is based on Unicode's CLDR 42 data set.

Locale-specific patterns for formatting and parsing:

  • dates
  • times
  • timezones
  • numbers and currency values
  • measurement units

Translations of names:

  • languages
  • scripts
  • countries and regions
  • currencies
  • eras
  • months
  • weekdays
  • day periods
  • time zones
  • cities
  • and time units
  • emoji characters and sequences (and search keywords)

Language & script information:

  • characters used
  • plural cases
  • gender of lists
  • capitalization
  • rules for sorting & searching
  • writing direction
  • transliteration rules
  • rules for spelling out numbers
  • rules for segmenting text into graphemes, words, and sentences
  • keyboard layouts

Country information:

  • language usage
  • currency information
  • calendar preference
  • week conventions

Validity:

Definitions, aliases, and validity information for Unicode

  • locales
  • languages
  • scripts
  • regions
  • extensions

Usage

local CLDR = require("cldr")

-- Table (pl.Set) of all available locales
CLDR.locales

Changelog

Please see CHANGELOG.md.

Other Formats

The CLDR data is provided upstream in LDML format (XML based). A JSON dump is also available.

License

The Lua interfaces and code in this project are licensed under the MIT license.

All CLDR data provided by the Unicode Consortium is governed by the Unicode Terms of Use.