3 module PluralizationFallback
4 def pluralize(locale, entry, count)
6 rescue InvalidPluralizationData => ex
7 raise ex unless ex.entry.key?(:other)
13 def store_translations_with_normalisation(locale, data, options = {})
14 locale = I18n::Locale::Tag::Rfc4646.tag(locale).to_s
16 store_translations_without_normalisation(locale, data, options)
19 alias_method_chain :store_translations, :normalisation
25 def default_fallbacks_with_validation
26 default_fallbacks_without_validation.select do |locale|
27 ::I18n.available_locales.include?(locale)
31 alias_method_chain :default_fallbacks, :validation
36 I18n::Backend::Simple.include(I18n::Backend::PluralizationFallback)
37 I18n::Backend::Simple.include(I18n::Backend::Fallbacks)
39 I18n.fallbacks.map("no" => "nb")
41 I18n.enforce_available_locales = false
43 Rails.configuration.after_initialize do
44 I18n.available_locales