Ruby-cldr

I’ve finally come around working on my cldr code a little bit.

GitHub - ruby-i18n/ruby-cldr: Ruby library for exporting data from CLDR (Common Locale Data Repository)
RubyGems.org | your community gem host

The goals of this library are twofold:

  • provide access to CLDR data in Ruby
  • provide means to use CLDR data (such as formats) in Ruby

At the same time I want to:

  • not tie the library to neither I18n nor Rails but
  • make it very easy to use and extend it in I18n and/or Rails

As CLDR provides not only well maintained but also tons of data people
need to be able to export particular slices or aspects of the data
they’re interested in (e.g. maybe they only want number formats for a
single language).

The current state allows to:

  • export data to YAML (and Ruby for plural rules) using a thor commands
    (optionally exports specified locales and/or data components)
  • format numbers (decimal, percentage, currency), dates, times,
    datetimes using this data

I’ve also added a module to I18n that can be included to the Simple
backend and will overwrite the #localize method:

http://github.com/svenfuchs/i18n/blob/master/lib/i18n/backend/cldr.rb

One of the things I want to look into next is exporting the CLDR data as
Ruby classes (as an alternative to YAML).

Obviously, this is all still in a very early state but feeback,
suggestions etc. are very welcome.

Enjoy :slight_smile: