grosser / i18n_data

Ruby: country/language names and 2-letter-code pairs, in 85 languages, for country/language i18n
MIT License
217 stars 63 forks source link

Translations

Through pkg-isocodes:

Install

gem install i18n_data

Usage

require 'i18n_data'
...
I18nData.languages        # {"DE"=>"German",...}
I18nData.languages('DE')  # {"DE"=>"Deutsch",...}
I18nData.languages('FR')  # {"DE"=>"Allemand",...}
...

I18nData.countries        # {"DE"=>"Germany",...}
I18nData.countries('DE')  # {"DE"=>"Deutschland",...}
...

I18nData.language_code('German')       # DE
I18nData.language_code('Deutsch')      # DE
I18nData.language_code('Allemand')     # DE
..

I18nData.country_code('Germany')       # DE
I18nData.country_code('Deutschland')   # DE
..

Data Providers

Development

Alphabetical localized sorting

If you would like to have the countries list sorted alphabetically in different languages there is a gem called sort_alphabetical for that.

TODO

Authors

Contributors

Michael Grosser
michael@grosser.it
License: MIT
CI