Skip to content
Extraits de code Groupes Projets
i18n_interpolation_fallbacks.rb 706 octets
Newer Older
  • Learn to ignore specific revisions
  • module I18n
      module Backend
        module InterpolationFallbacks
          def translate(locale, key, options = {})
    
            default = extract_non_symbol_default!(options) if options[:default]
    
            options.merge!(:default => default) if default
    
            I18n.fallbacks[locale].each do |fallback|
              begin
                result = super(fallback, key, options)
                return result unless result.nil?
    
              rescue I18n::MissingInterpolationArgument, I18n::InvalidPluralizationData => e
                original_exception ||= e
    
            return super(locale, nil, options) if default