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 compute(tags, include_defaults = true, exclude = [])
23 result = Array(tags).collect do |tag|
24 tags = I18n::Locale::Tag.tag(tag).self_and_parents.map! { |t| t.to_sym } - exclude
25 tags.each { |_tag| tags += compute(@map[_tag], false, exclude + tags) if @map[_tag] }
28 result.push(*defaults) if include_defaults
35 I18n::Backend::Simple.include(I18n::Backend::Pluralization)
36 I18n::Backend::Simple.include(I18n::Backend::PluralizationFallback)
37 I18n.load_path << "#{Rails.root}/config/pluralizers.rb"
39 I18n::Backend::Simple.include(I18n::Backend::Fallbacks)
41 I18n.fallbacks.map("nb" => "no")
42 I18n.fallbacks.map("no" => "nb")
44 Rails.configuration.after_initialize do