Rails Locale Data Repository

Central point to collect locale data for use in Ruby on Rails.

Gem installation

Add to your Gemfile:

gem'rails-i18n','~> 5.0.0'# For 5.0.xgem'rails-i18n','~> 4.0.0'# For 4.0.xgem'rails-i18n','~> 3.0.0'# For 3.xgem'rails-i18n',github:'svenfuchs/rails-i18n',branch:'master'# For 5.xgem'rails-i18n',github:'svenfuchs/rails-i18n',branch:'rails-4-x'# For 4.xgem'rails-i18n',github:'svenfuchs/rails-i18n',branch:'rails-3-x'# For 3.x

or run this command:

geminstallrails-i18n-v'~> 5.0.0'# For 5.0.0geminstallrails-i18n-v'~> 4.0.0'# For 4.0.xgeminstallrails-i18n-v'~> 3.0.0'# For 3.x

Note that your rails version must be 3.0 or higher if you want to install rails-i18n as a gem. For rails 2.x, install it manually as described below.

Configuration

By default rails-i18n loads all locale files, pluralization and
transliteration rules available in the gem. This behaviour can be changed, if you
specify in config/environments/* the locales which have to be loaded via
I18n.available_locales option:

config.i18n.available_locales=['es-CO',:de]

or

config.i18n.available_locales=:nl

Manual installation

Download the locale files that are found in the directory rails/locale and put them into the config/locales directory of your Rails application.

If any translation doesn't suit well to the requirements of your application, edit them or add your own locale files.

Currently, most locales are incomplete. Typically they lack the following keys:

activerecord.errors.messages.record_invalid

activerecord.errors.messages.restrict_dependent_destroy.has_one

activerecord.errors.messages.restrict_dependent_destroy.has_many

errors.messages.model_invalid

errors.messages.required

We always welcome your contributions!

Currency symbols

Some locales have the symbol of the currency (e.g. €) under the key number.currency.format.unit,
while others have the code (e.g. CHF). The value of the key depends on the widespread adoption of
the unicode currency symbols by fonts.

For example the Turkish Lira sign (₺) was recently added in Unicode 6.2 and while most popular
fonts have a glyph, there are still many fonts that will not render the character correctly.

If you want to provide a different value, in a Rails app, you can create your own locale file under
config/locales/tr.yml and override the respective key:

tr:
number:
currency:
format:
unit: TL

How to contribute

Quick contribution

If you are familiar with GitHub operations, follow the procedures described in the subsequent sections.