我有几个翻译隐藏在初始化器中,如下所示:
GROUP_GOVERNANCE_STYLES = [
[I18n.t("constants.group_governance_styles.collective"), 1],
[I18n.t("constants.group_governance_styles.electoral_democracy"), 2],
[I18n.t("constants.group_governance_styles.dictatorship"), 3]
]
在我的 en.yml 文件中,我有:
en:
constants:
group_governance_styles:
collective: "collective"
electoral_democracy: "electoral democracy"
dictatorship: "dictatorship"
不幸的是,当我尝试在视图中呈现这些翻译时,出现以下错误:
translation missing: en.constants.group_governance_styles.collective
translation missing: en.constants.group_governance_styles.electoral_democracy
translation missing: en.constants.group_governance_styles.dictatorship
我也试过删除范围,但翻译仍然缺失。还有另一种方法可以解决这个问题吗?也许有一个我不知道的初始化程序的默认范围?