【发布时间】:2021-06-09 16:45:36
【问题描述】:
我不知道我正在寻找的东西是否可能,但我有以下 YAML
en:
log:
model1:
update:
description: "My description for update"
variable1: "something"
variable2: "something else"
model2:
update:
description: "My description for update"
variable3: "another thing"
variable4: "still different"
我希望能够用这个替换这个 t("log.model1.update.description)" 以获得相同的结果
t("log.model1.update") 和以后仍然可以做到这一点t("log.model1.update.variable1)
我想避免为每个模型的每个动作创建一个描述键
他们是不是有一种更干燥的方法?
【问题讨论】:
标签: yaml rails-i18n