Internationalization - thuy-econsys/rails_app GitHub Wiki

Rails translate helper method:

flash[:notice] = I18n.t(:signed_up, scope: [:devise, :registrations])

vs

Devise method which is essentially a wrapper for Rails method above:

set_flash_message!(:notice, :signed_up)

config/locales/devise.en.yml

en:
  devise:
    registrations:
      signed_up: "Welcome! You have signed up successfully."

A translation missing: en.devise.failure.user.not_approved alert will be generated if you don't add a proper alert to your config/locales/devise.en.yml file. Note the nesting of the yaml file in relation to the alert about the missing translation:


en:
  devise:
...  
    failure:
...
      user:
        not_approved: "Your account has not been approved by your administrator yet."

References