Sha256: 4ef599342498492b62b4ce6a68b7f668c53f57530baa7eb6a83663aa582f9f72

Contents?: true

Size: 1.55 KB

Versions: 27

Compression:

Stored size: 1.55 KB

Contents

module I18n
  class ArgumentError < ::ArgumentError; end
  
  class InvalidLocale < ArgumentError
    attr_reader :locale
    def initialize(locale)
      @locale = locale
      super "#{locale.inspect} is not a valid locale"
    end
  end

  class MissingTranslationData < ArgumentError
    attr_reader :locale, :key, :options
    def initialize(locale, key, options)
      @key, @locale, @options = key, locale, options
      keys = I18n.send(:normalize_translation_keys, locale, key, options[:scope])
      keys << 'no key' if keys.size < 2
      super "translation missing: #{keys.join(', ')}"
    end
  end

  class InvalidPluralizationData < ArgumentError
    attr_reader :entry, :count
    def initialize(entry, count)
      @entry, @count = entry, count
      super "translation data #{entry.inspect} can not be used with :count => #{count}"
    end
  end

  class MissingInterpolationArgument < ArgumentError
    attr_reader :key, :string
    def initialize(key, string)
      @key, @string = key, string
      super "interpolation argument #{key} missing in #{string.inspect}"
    end
  end

  class ReservedInterpolationKey < ArgumentError
    attr_reader :key, :string
    def initialize(key, string)
      @key, @string = key, string
      super "reserved key #{key.inspect} used in #{string.inspect}"
    end
  end
  
  class UnknownFileType < ArgumentError
    attr_reader :type, :filename
    def initialize(type, filename)
      @type, @filename = type, filename
      super "can not load translations from #{filename}, the file type #{type} is not known"
    end
  end
end  

Version data entries

27 entries across 26 versions & 11 rubygems

Version Path
p8-castronaut-0.6.1.1 vendor/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/exceptions.rb
relevance-castronaut-0.6.0 vendor/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/exceptions.rb
relevance-castronaut-0.6.1 vendor/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/exceptions.rb
relevance-castronaut-0.7.4 vendor/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/exceptions.rb
relevance-castronaut-0.7.5 vendor/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/exceptions.rb
yaroslav-russian-0.0.1 lib/vendor/i18n/lib/i18n/exceptions.rb
yaroslav-russian-0.0.2 lib/vendor/i18n/lib/i18n/exceptions.rb
yaroslav-russian-0.0.3 lib/vendor/i18n/lib/i18n/exceptions.rb
yaroslav-russian-0.0.4 lib/vendor/i18n/lib/i18n/exceptions.rb
yaroslav-russian-0.0.5 lib/vendor/i18n/lib/i18n/exceptions.rb
yaroslav-russian-0.0.6 lib/vendor/i18n/lib/i18n/exceptions.rb
nbudin-castronaut-0.7.5 vendor/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/exceptions.rb
usher-0.7.0 spec/rails2_2/vendor/rails/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/exceptions.rb
usher-0.7.0 spec/rails2_2/vendor/rails/vendor/rails/activesupport/pkg/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/exceptions.rb
factorylabs-castronaut-0.7.5 vendor/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/exceptions.rb
activesupport-2.2.3 lib/active_support/vendor/i18n-0.0.1/i18n/exceptions.rb
activesupport-2.2.2 lib/active_support/vendor/i18n-0.0.1/i18n/exceptions.rb
i18n-0.1.0 lib/i18n/exceptions.rb
mack-active_record-0.8.2 lib/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/exceptions.rb
mack-facets-0.8.3.1 lib/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/exceptions.rb