Zeq*_*uez 15 activerecord locale ruby-on-rails internationalization models
我尝试了以下方法:
es:
activerecord:
attributes:
name: Nombre
Run Code Online (Sandbox Code Playgroud)
它没有用.
但以下工作:
es:
activerecord:
attributes:
person:
name: Nombre
Run Code Online (Sandbox Code Playgroud)
哪种方法可以跨模型定义默认属性?
我也在使用Formtastic和Active Admin.
Hal*_*gür 37
将共同点attributes向上移动一级:
es:
attributes:
name: Nombre
activerecord:
attributes:
user:
birthday: Etc
Run Code Online (Sandbox Code Playgroud)
这就是我在做的事情.不完美但会完成这项工作.
activerecord:
attributes:
attribute_commons: &commons
name: Nome
description: Descrição
user:
<<: *commons
role:
<<: *commons
level: Nível
product:
<<: *commons
size: Tamanho
Run Code Online (Sandbox Code Playgroud)