简体   繁体   中英

Devise attributes for i18n?

How can I translate the attributes of Devise's models? Eg 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?

我自己偶然发现了解决方案:我必须在simple_form的命名空间中定义模型名称,如下所述: https//github.com/plataformatec/simple_form (bottom)。

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM