Devise attributes for i18n?

荒凉一梦 提交于 2019-12-12 12:13:13

问题


How can I translate the attributes of Devise's models? E.g. session.email or session.remember_me.

Both hierarchies

de:
  devise:
    sessions:
      email: "E-Mail"

and

de:
  activerecord:
    attributes:
      session:
        email: "E-Mail"

do not work. What is the right identifier?


回答1:


I stumbled upon the solution by myself: I have to define the model names in the namespace of simple_form as described here: https://github.com/plataformatec/simple_form (bottom).




回答2:


The Devise I18n config files are for flash messages and subject titles to emails. You need to generate the views and modify them accordingly with:

rails generate devise:views


来源:https://stackoverflow.com/questions/5543594/devise-attributes-for-i18n

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!