README.md in rails-i18n-6.0.0.beta1 vs README.md in rails-i18n-6.0.0
- old
+ new
@@ -1,43 +1,51 @@
Rails Locale Data Repository
============================
[![Gem Version](https://badge.fury.io/rb/rails-i18n.svg)](http://badge.fury.io/rb/rails-i18n)
-[![Build Status](https://secure.travis-ci.org/svenfuchs/rails-i18n.png)](http://travis-ci.org/svenfuchs/rails-i18n)
+[![Build Status](https://secure.travis-ci.org/svenfuchs/rails-i18n.svg)](http://travis-ci.org/svenfuchs/rails-i18n)
Centralization of locale data collection for Ruby on Rails.
## Gem Installation
Include the gem to your Gemfile:
- gem 'rails-i18n', '~> 6.0.0.beta1' # For 6.0.0.beta1 or higher
- gem 'rails-i18n', '~> 5.1' # For 5.0.x, 5.1.x and 5.2.x
- gem 'rails-i18n', '~> 4.0' # For 4.0.x
- gem 'rails-i18n', '~> 3.0' # For 3.x
- gem 'rails-i18n', github: 'svenfuchs/rails-i18n', branch: 'master' # For 5.x
- gem 'rails-i18n', github: 'svenfuchs/rails-i18n', branch: 'rails-4-x' # For 4.x
- gem 'rails-i18n', github: 'svenfuchs/rails-i18n', branch: 'rails-3-x' # For 3.x
+``` ruby
+gem 'rails-i18n', '~> 6.0.0.beta1' # For 6.0.0.beta1 or higher
+gem 'rails-i18n', '~> 5.1' # For 5.0.x, 5.1.x and 5.2.x
+gem 'rails-i18n', '~> 4.0' # For 4.0.x
+gem 'rails-i18n', '~> 3.0' # For 3.x
+gem 'rails-i18n', github: 'svenfuchs/rails-i18n', branch: 'master' # For 5.x
+gem 'rails-i18n', github: 'svenfuchs/rails-i18n', branch: 'rails-4-x' # For 4.x
+gem 'rails-i18n', github: 'svenfuchs/rails-i18n', branch: 'rails-3-x' # For 3.x
+```
Alternatively, execute the following command:
- gem install rails-i18n -v '~> 6.0.0.beta1' # For 6.0.0.beta1 or higher
- gem install rails-i18n -v '~> 5.1' # For For 5.0.x, 5.1.x and 5.2.x
- gem install rails-i18n -v '~> 4.0' # For 4.0.x
- gem install rails-i18n -v '~> 3.0' # For 3.x
+``` shell
+gem install rails-i18n -v '~> 6.0.0.beta1' # For 6.0.0.beta1 or higher
+gem install rails-i18n -v '~> 5.1' # For For 5.0.x, 5.1.x and 5.2.x
+gem install rails-i18n -v '~> 4.0' # For 4.0.x
+gem install rails-i18n -v '~> 3.0' # For 3.x
+```
Note that your Ruby on Rails version must be 3.0 or higher in order to install the `rails-i18n` gem. For rails 2.x, install it manually as described in the Manual Installation section below.
## Configuration
`rails-i18n` gem initially loads all available locale files, pluralization and transliteration rules. This default 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]
+``` ruby
+config.i18n.available_locales = ['es-CO', :de]
+```
or
- config.i18n.available_locales = :nl
+``` ruby
+config.i18n.available_locales = :nl
+```
## Manual Installation
Download desired locale files found in [rails/locale](http://github.com/svenfuchs/rails-i18n/tree/master/rails/locale/) directory and move them into the `config/locales` directory of your Rails application.
@@ -63,11 +71,11 @@
Complete locales:
> af, da, de, de-AT, de-CH, de-DE, en-US, es, es-419, es-AR, es-CL, es-CO, es-CR, es-EC,
> es-ES, es-MX, es-NI, es-PA, es-PE, es-US, es-VE, et, fa, fr, fr-CA, fr-CH, fr-FR, id, ja, ka, ml, nb,
-> nl, nn, pt-BR, sv, sv-SE, tr, zh-CN, zh-HK, zh-TW, zh-YUE, uk
+> nl, nn, pt, pt-BR, sv, sv-SE, tr, zh-CN, zh-HK, zh-TW, zh-YUE, uk
Currently, most locales are incomplete. Typically they lack the following keys:
- `activerecord.errors.messages.record_invalid`
- `activerecord.errors.messages.restrict_dependent_destroy.has_one`
@@ -87,11 +95,11 @@
fonts have a glyph, there are still many fonts that will not render the character correctly.
If you want to provide a different value, you can create a custom locale file under
`config/locales/tr.yml` and override the respective key:
-```YAML
+``` yaml
tr:
number:
currency:
format:
unit: TL
@@ -121,27 +129,43 @@
### Testing your Locale File
Before committing and pushing your changes, test the integrity of your locale file.
- bundle exec rake spec
+``` shell
+bundle exec rake spec
+```
Make sure you have included all translations with:
- bundle exec rake i18n-spec:completeness rails/locale/en.yml rails/locale/YOUR_NEW_LOCALE.yml
+``` shell
+bundle exec rake i18n-spec:completeness rails/locale/en.yml rails/locale/YOUR_NEW_LOCALE.yml
+```
+Make sure it is normalized with:
+
+``` shell
+thor locales:normalize LOCALE # or "thor locales:normalize_all"
+```
+
You can list all complete and incomplete locales:
- thor locales:complete
- thor locales:incomplete
+``` shell
+thor locales:complete
+thor locales:incomplete
+```
Also, you can list all available locales:
- thor locales:list
+``` shell
+thor locales:list
+```
You can list all missing keys:
- i18n-tasks missing es
+``` shell
+i18n-tasks missing es
+```
### Edit README.md
Add your locale name to the list in `README.md` if it isn't there.