I would like to translate my rails application in two languages, french and english but got some problem. I've got the following error:
"fr" is not a valid locale
In my config/application.rb:
I18n.enforce_available_locales = false
I18n.config.available_locales = :fr
config.i18n.default_locale = :en
And in my controller, I receive the locale in parameters:
I18n.locale = export_params[:lang] || I18n.default_locale
I don't have any problem with the locale "en". My app is well translated but I've this error message when I use a different parameter than "en".
I use Rails 4.2.0
OK, it works. I just need to restart the server.
Check at your application.rb
if config.i18n.available_locales = :en
is set to your language and also check inside config/locales
if you already heave your language.yml created there.
After all don't forget to reset your server
regards
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