I am trying to translate my application. I put this in config/application.rb :
config.i18n.default_locale = :fr
And i create the active_admin.fr.yml file :
fr:
active_admin:
dashboard: "Tableau de Bord"
dashboard_welcome:
welcome: "Bienvenue dans Active Admin. Ceci est la page par défaut."
call_to_action: "Pour ajouter des sections au tableau de bord, consultez 'app/admin/dashboards.rb'"
....
If i change the "fr:" to ":en" it's working.
Any idea what i did wrong? (I rebooted apache)
Thank you for help.
Edit :
The solution was to use :
I18n.default_locale = :fr
and not
config.i18n.default_locale = :fr
Have you uncommented this line:
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '*.{rb,yml}').to_s] # default one has "my" instead of "config", which is wrong
I prefer to use this line instead, so it is recursively including files in sub-folders too:
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
Bonne chance!
My answer was to use
config.i18n.default_locale = :fr
instead of
I18n.default_locale = :fr
Thank you for help.
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