I have deployed devise & devise-i18n to internationalize devise. Everything works well - including all the i18n - except that flash messages generated by devise do not get translated
=> messages generated by devise and accessed via resource.errors.full_messages are localized
e.g. try to “sign_up” with no information filled in
=> flashes generated by devise are not localized
e.g. try to “sign_in” with no information filled in
From the code you can see it uses internationalization
You can do something like this on an initializer so override the I18n
lookup method to print each key it tries to find, maybe you can
debug what's going on:
# config/initializers/debug_18n.rb
module I18n
module Backend
class Simple
# Monkey-patch-in localization debugging
# Enable with ENV['I18N_DEBUG']=1 on the command line in server startup, or
./config/environments/*.rb file.
Thank you very much for your message. I discovered actually that someone had developed an i18n debug Gem that is very helpful to troubleshoot this.
I discovered actually that some keys where missing and that for some reason i18n was first relying on the fallback locale instead of looking in the translation file.
Filling in the missing locale entries allowed me to fix this.