X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/420a7289a0b08eee091f6650c2e83166df3fbe69..ca7721168f8576adf461b58193260e10aa14be7f:/config/initializers/i18n.rb?ds=sidebyside diff --git a/config/initializers/i18n.rb b/config/initializers/i18n.rb index b4399a9f8..266e41cbb 100644 --- a/config/initializers/i18n.rb +++ b/config/initializers/i18n.rb @@ -3,10 +3,10 @@ module I18n module PluralizationFallback def pluralize(locale, entry, count) super - rescue InvalidPluralizationData => ex - raise ex unless ex.entry.key?(:other) + rescue InvalidPluralizationData => e + raise e unless e.entry.key?(:other) - ex.entry[:other] + e.entry[:other] end end end @@ -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