3     module PluralizationFallback
 
   4       def pluralize(locale, entry, count)
 
   6       rescue InvalidPluralizationData => e
 
   7         raise e unless e.entry.key?(:other)
 
  17     module NormaliseLocales
 
  18       def store_translations(locale, data, options = {})
 
  19         locale = ::I18n::Locale::Tag::Rfc4646.tag(locale).to_s
 
  27 I18n::Backend::Simple.prepend(OpenStreetMap::I18n::NormaliseLocales)
 
  29 I18n::Backend::Simple.include(I18n::Backend::PluralizationFallback)
 
  30 I18n::Backend::Simple.include(I18n::Backend::Fallbacks)
 
  32 I18n.enforce_available_locales = false
 
  35   I18n.exception_handler = proc do |exception|
 
  36     raise exception.to_exception
 
  40 Rails.configuration.after_initialize do
 
  41   require "i18n-js/listen"
 
  43   # This will only run in development.
 
  46   I18n.available_locales