3 module PluralizationFallback
4 def pluralize(locale, entry, count)
6 rescue InvalidPluralizationData => ex
7 raise ex unless ex.entry.has_key?(:other)
15 def make_ordered(unordered)
16 ordered = ActiveSupport::OrderedHash.new
18 unordered.keys.sort { |a,b| a.to_s <=> b.to_s }.each do |key|
19 value = unordered[key]
22 ordered[key] = make_ordered(value)
31 def filtered_translations_with_order
32 make_ordered(filtered_translations_without_order)
35 alias_method_chain :filtered_translations, :order
40 I18n::Backend::Simple.include(I18n::Backend::PluralizationFallback)
41 I18n::Backend::Simple.include(I18n::Backend::Fallbacks)
43 I18n.fallbacks.map("no" => "nb")
45 I18n.enforce_available_locales = false
47 Rails.configuration.after_initialize do
48 I18n.available_locales