Make all translation lookup errors throw exceptions in test mode

This commit is contained in:
Tom Hughes 2019-12-16 21:39:05 +00:00
parent ac6a872a48
commit 4ee60c0f8f
3 changed files with 49 additions and 29 deletions

View file

@ -42,6 +42,12 @@ I18n.fallbacks.map("no" => "nb")
I18n.enforce_available_locales = false
if Rails.env.test?
I18n.exception_handler = proc do |exception|
raise exception.to_exception
end
end
Rails.configuration.after_initialize do
I18n.available_locales
end