I have to develop a Ruby on Rails app for my company and don't know how to configure it for a French site.
I don't need multiple language support, I just want to have error messages, pluralization and date format for French.
I tried to set:
config.i18n.default_locale = :fr
in my application.rb
file but it doesn't seem to have any effect.
Are these features already implemented in RoR 3? Or I will have to translate these things myself?
To set your application to French you need to set config.i18n.default_locale = :fr
in your config/application.rb
, create fr.yml
file in your aplication config/locales
folder and add needed localized strings to this file. Check this out:
fr.yml
this will help you to translate dates and etc.
As far as I know, Rails comes with en locale only. You can get additional locales here: https://github.com/svenfuchs/rails-i18n/tree/master/rails/locale/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With