为i18n设计属性? [英] Devise attributes for i18n?
本文介绍了为i18n设计属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何翻译Devise模型的属性?例如。 session.email
或 session.remember_me
。
How can I translate the attributes of Devise's models? E.g. session.email
or session.remember_me
.
两个层次结构
de:
devise:
sessions:
email: "E-Mail"
和
de:
activerecord:
attributes:
session:
email: "E-Mail"
不工作。什么是正确的标识符?
do not work. What is the right identifier?
推荐答案
我自己绊倒了解决方案:我必须在命名空间中定义模型名称simple_form如下所述: https://github.com/plataformatec/simple_form (底部)。
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).
这篇关于为i18n设计属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文