Ruby on Rails framework Localization
Only English plural rules (one/other) are supported in the Ruby on Rails framework and English plural rules are working for most western languages, including German. However, it is not working correctly for Japanese, Arabic, etc. To make it work, your application would need additional support from a pluralization gem.
How to support i18n in Rail applications:
1. Download i18n plurals.rb gem file here
https://github.com/svenfuchs/i18n/blob/master/test/test_data/locales/plurals.rb
2. Put plurals.rb under directory config/locales/
3. In your application, add a file "config/initializers/pluralization.rb" with following contents
```
require "i18n/backend/pluralization"
I18n::Backend::Simple.send(:include, I18n::Backend::Pluralization)
```
4. Restart the rails application. Correct plural phrases and plural rules is used in all the languages.
Comments
0 comments
Please sign in to leave a comment.