Kingsman: Configuring Internationalization
Important: These docs are for the outdated Jets 5 versions and below. For the latest Jets docs: docs.rubyonjets.com
Kingsman uses flash messages with I18n, in conjunction with the flash keys :notice
and :alert
. To customize your app, you can set up your locale file:
en:
kingsman:
sessions:
signed_in: 'Signed in successfully.'
You can also create distinct messages based on the resource you’ve configured using the singular name given in routes:
en:
kingsman:
sessions:
user:
signed_in: 'Welcome user, you are signed in.'
admin:
signed_in: 'Hello admin!'
The Kingsman mailer uses a similar pattern to create subject messages:
en:
kingsman:
mailer:
confirmation_instructions:
subject: 'Hello everybody!'
user_subject: 'Hello User! Please confirm your email'
reset_password_instructions:
subject: 'Reset instructions'
Take a look at our locale file to check all available messages. You may also be interested in one of the many translations that are available on our the devise wiki.
Caution: Kingsman Controllers inherit from ApplicationController. If your app uses multiple locales, you should be sure to set I18n.locale in ApplicationController.