No commit activity in last 3 years
No release in over 3 years
I18n missing functionnalities
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 0.6
 Project Readme

I18n::Complements¶ ↑

<img src=“https://badge.fury.io/rb/i18n-complements.png” alt=“Gem Version” /> <img src=“https://api.travis-ci.org/ekylibre/i18n-complements.png?branch=master”/> <img src=“https://gemnasium.com/ekylibre/i18n-complements.png”/> <img src=“https://codeclimate.com/github/ekylibre/i18n-complements.png” /> <img src=“https://coveralls.io/repos/ekylibre/i18n-complements/badge.png?branch=master” alt=“Coverage Status” />

I18n complements provides:

  • Numbers localization

  • Moneys localization (through ISO4217 codes)

  • Boolean localization

  • String localization (do nothing but permits to generalize use of localization)

Localize numbers¶ ↑

I18n.localize(2015.2, :locale => :eng) # => "2,015.200"
I18n.localize(2015.2, :locale => :fra) # => "2 015,200"

With extensions:

2015.2.l(:locale => :eng) # => "2,015.200"
2015.2.l(:locale => :fra) # => "2 015,200"

Localize money¶ ↑

I18n.localize(13500, :currency => :JPY, :locale => :eng) # => "¥13,500"
I18n.localize(13500, :currency => :JPY, :locale => :fra) # => "13 500 ¥"
I18n.localize(13500, :currency => :JPY, :locale => :jpn) # => "13,500円"

I18n.localize(13500, :currency => :EUR, :locale => :eng) # => "€13,500.00"
I18n.localize(13500, :currency => :EUR, :locale => :fra) # => "13 500,00 €"

With extensions:

13500.l(:currency => :JPY, :locale => :jpn) # => "13,500円"

Extensions¶ ↑

Moreover it extends String, and Symbol for translations:

I18n.t("my.example", options..)
# is equivalent to
"my.example".t(options...)

Or

I18n.t(:this_is_another_example, options..)
# is equivalent to
:this_is_another_example.t(options...)

And it extends Date, DateTime and Time for localization:

Date.civil(2012, 1, 1).l(:locale => :fra) # => "1 janvier 2012"

Manipulating currencies¶ ↑

To find existing currencies:

I18n.active_currencies # returns the list of used currencies
I18n.available_currencies # returns all known currencies
I18n.currency(<currency_code>) # returns a Currency object with its properties

To do¶ ↑

  • Enhance numerals localization using systems (decimal, vigesimal…) and characters of the language for numerals. Ex: Abjad numerals (ا, ب, ج, د…), Roman numbers (Ⅰ, Ⅱ, Ⅲ, Ⅳ…), traditional chinese/japanese numbers (一, 二, 三, 四…),