Code Monkey home page Code Monkey logo

cldr-lua's Introduction

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.

cldr-lua's People

Contributors

alerque avatar

Watchers

 avatar  avatar  avatar  avatar

cldr-lua's Issues

Include character data

SILE uses this character set data that it extracted from LaTeX somewhere, but I think the essence of this data is probably originally and more canonically in the CLDR data somewhere. Figure out where that is and see if we can extract it in a useful way. Note the copy in SILE is 2MB of source, so this might be a good time to introduce some testing to make sure we balance storage vs. load speed. Does serializing or compressing the data help in any way?

See related issue: sile-typesetter/sile#686

fix the dev rockspec source

I am doing some due changes to the lua package set in nixpkgs NixOS/nixpkgs#190067 and updating cldr fails
because the updater runs the wrong command:

nix-prefetch-git --fetch-submodules --quiet https://github.com/alerque/cldr-lua.git --rev refs/tags/master
Initialized empty Git repository in /tmp/git-checkout-tmp-jOX48YMM/cldr-lua/.git/
fatal: couldn't find remote ref refs/tags/master
From https://github.com/alerque/cldr-lua
 * branch            HEAD       -> FETCH_HEAD
fatal: Not a valid object name 

Looking at https://github.com/alerque/cldr-lua/blob/master/cldr-dev-0.rockspec the source contains tag = "master". https://github.com/alerque/cldr-lua/blob/master/cldr.rockspec.in assumes a tag but "master" was used (incorrectly) as a tag, according to the spec https://github.com/luarocks/luarocks/wiki/Rockspec-format "tag" should become "branch".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.