我经常忘记用我的应用程序的所有语言翻译诸如 activerecord.errors.models.user.attributes.name.blank
之类的东西。有人对跟踪翻译缺失的地方有什么建议吗?
最佳答案
您可以做的一件事是在您的测试环境中设置 I18n.config.exception_handler = :raise_i18n_exception
。它不会捕获所有内容,但它 super 简单,总比没有好。
(在 config/environments/test.rb 中它只是 I18n.exception_handler = :raise_i18n_exception
)
关于ruby-on-rails - 跟踪 ActiveRecord 的国际化验证消息的最佳方式是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6542007/