4 def find_first_string_or_lambda_default(defaults)
5 defaults.each_with_index { |default, ix| return ix if default && !default.is_a?(Symbol) }
10 module PluralizationFallback
11 def pluralize(locale, entry, count)
13 rescue InvalidPluralizationData => ex
14 raise ex unless ex.entry.has_key?(:other)
22 def make_ordered(unordered)
23 ordered = ActiveSupport::OrderedHash.new
25 unordered.keys.sort { |a,b| a.to_s <=> b.to_s }.each do |key|
26 value = unordered[key]
29 ordered[key] = make_ordered(value)
38 def filtered_translations_with_order
39 make_ordered(filtered_translations_without_order)
42 alias_method_chain :filtered_translations, :order
47 I18n::Backend::Simple.include(I18n::Backend::PluralizationFallback)
48 I18n::Backend::Simple.include(I18n::Backend::Fallbacks)
50 I18n.fallbacks.map("no" => "nb")