我正在尝试在我的一个模型中的集合中添加 I18n。当我初始化服务器/控制台并调用集合时,翻译丢失,但在重新加载应用程序或控制台后,翻译出现。
这是示例:
[1] pry(main)> Listing::CONDITIONS
=> [["translation missing: en.activerecord.attributes.listing.conditions.new",
"new"], ["translation missing: en.activerecord.attributes.listing.conditions.used-new",
"used-new"], ["translation missing: en.activerecord.attributes.listing.conditions.used-vgood",
"used-vgood"], ["translation missing: en.activerecord.attributes.listing.conditions.used-good",
"used-good"], ["translation missing: en.activerecord.attributes.listing.conditions.used-acceptable",
"used-acceptable"]]
[2] pry(main)> reload!
Reloading...
=> true
[3] pry(main)> Listing::CONDITIONS
=> [["New", "new"],
["Used - Like New", "used-new"],
["Used - Very Good", "used-vgood"],
["Used - Good", "used-good"],
["Used - Acceptable", "used-acceptable"]]
有任何想法吗?