]> git.openstreetmap.org Git - rails.git/blobdiff - config/initializers/i18n.rb
Merge pull request #5362 from AntonKhorev/color-mode-preference-map
[rails.git] / config / initializers / i18n.rb
index b4399a9f868348640deece25f915345fda95fe5a..8f74c3cd39455a0b5548aa8d6a364da9259a1309 100644 (file)
@@ -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
@@ -18,7 +18,7 @@ module OpenStreetMap
       def store_translations(locale, data, options = {})
         locale = ::I18n::Locale::Tag::Rfc4646.tag(locale).to_s
 
-        super(locale, data, options)
+        super
       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