Coder Social home page Coder Social logo

ruby-cldr's Introduction

Ruby library for exporting data from CLDR

Tests

The Unicode Consortium's Common Locale Data Repository (CLDR) contains tons of high-quality locale data such as formatting rules for dates, times, numbers, currencies as well as language, country, calendar-specific names etc.

For localizing applications in Ruby we obviously want to use this incredibly comprehensive and well-maintained resource.

ruby-cldr exports the XML-serialized CLDR data as YAML and Ruby files, for consumption in an I18n context.

WIP status

ruby-cldr is a work in progress towards a complete and accurate serialization of the CLDR data as Ruby + YAML files.

There are still a number of issues that need to be addressed before it can be considered production-ready.

Requirements

Installation

gem install bundler
bundle install

thor cldr:download

Export

By default, the thor cldr:export command will export all known components from all locales to the target directory:

thor cldr:export

Locales, components, and target directory

You can also optionally specify locales and/or components to export as well as the target directory:

# Export the `Numbers` and `Plurals` components for the locales `de`, `fr-FR` and `en-ZA` to the `./data` target directory

thor cldr:export --locales de fr-FR en-ZA --components Numbers Plurals --target=./data

Draft status

CLDR defines a hierarchy of four draft statuses, used to indicate how confident they are in the data: unconfirmed < provisional < contributed < approved.

By default, ruby-cldr only exports data with a minimum draft status of contributed (i.e., contributed or approved). This is the same threshold that is used by the Unicode Consortium's International Components for Unicode (ICU).

Set the --draft-status= parameter to specify the minimum draft status the data needs in order to be exported:

# Export any data with a minimum draft status of `provisional`
# (i.e., `provisional`, `contributed` or `approved`)).

thor cldr:export --draft-status=provisional

Tests

bundle exec ruby test/all.rb

Resources

ruby-cldr's People

Contributors

movermeyer avatar dependabot[bot] avatar tigrish avatar camertron avatar korri avatar kl-7 avatar davispuh avatar dpad46 avatar devanandersen avatar c960657 avatar yaroslav avatar froyomuffin avatar nearbuyjason avatar rafaelxy avatar

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.