File: active_support/vendor/i18n-0.4.1/i18n/exceptions.rb

Overview
Module Structure
Class Hierarchy
Code

Overview

Module Structure

  module: <Toplevel Module>
  module: I18n#9
  class: ArgumentError#10
inherits from
  ArgumentError ( Builtin-Module )
  class: InvalidLocale#12
inherits from
  ArgumentError ( I18n )
has properties
attribute: locale [R] #13
method: initialize / 1 #14
  class: MissingTranslationData#20
inherits from
  ArgumentError ( I18n )
has properties
attribute: locale [R] #21
attribute: key [R] #21
attribute: options [R] #21
method: initialize / 3 #22
  class: InvalidPluralizationData#30
inherits from
  ArgumentError ( I18n )
has properties
attribute: entry [R] #31
attribute: count [R] #31
method: initialize / 2 #32
  class: MissingInterpolationArgument#38
inherits from
  ArgumentError ( I18n )
has properties
attribute: values [R] #39
attribute: string [R] #39
method: initialize / 2 #40
  class: ReservedInterpolationKey#46
inherits from
  ArgumentError ( I18n )
has properties
attribute: key [R] #47
attribute: string [R] #47
method: initialize / 2 #48
  class: UnknownFileType#54
inherits from
  ArgumentError ( I18n )
has properties
attribute: type [R] #55
attribute: filename [R] #55
method: initialize / 2 #56
  class: KeyError#3
inherits from
  IndexError ( Builtin-Module )
has properties
method: initialize (2/E) / 1 #4

Class Hierarchy

Code

   1  # encoding: utf-8
   2 
   3  class KeyError < IndexError
   4    def initialize(message = nil)
   5      super(message || "key not found")
   6    end
   7  end unless defined?(KeyError)
   8 
   9  module I18n
  10    class ArgumentError < ::ArgumentError; end
  11 
  12    class InvalidLocale < ArgumentError
  13      attr_reader :locale
  14      def initialize(locale)
  15        @locale = locale
  16        super "#{locale.inspect} is not a valid locale"
  17      end
  18    end
  19 
  20    class MissingTranslationData < ArgumentError
  21      attr_reader :locale, :key, :options
  22      def initialize(locale, key, opts = nil)
  23        @key, @locale, @options = key, locale, opts || {}
  24        keys = I18n.normalize_keys(locale, key, options[:scope])
  25        keys << 'no key' if keys.size < 2
  26        super "translation missing: #{keys.join(', ')}"
  27      end
  28    end
  29 
  30    class InvalidPluralizationData < ArgumentError
  31      attr_reader :entry, :count
  32      def initialize(entry, count)
  33        @entry, @count = entry, count
  34        super "translation data #{entry.inspect} can not be used with :count => #{count}"
  35      end
  36    end
  37 
  38    class MissingInterpolationArgument < ArgumentError
  39      attr_reader :values, :string
  40      def initialize(values, string)
  41        @values, @string = values, string
  42        super "missing interpolation argument in #{string.inspect} (#{values.inspect} given)"
  43      end
  44    end
  45 
  46    class ReservedInterpolationKey < ArgumentError
  47      attr_reader :key, :string
  48      def initialize(key, string)
  49        @key, @string = key, string
  50        super "reserved key #{key.inspect} used in #{string.inspect}"
  51      end
  52    end
  53 
  54    class UnknownFileType < ArgumentError
  55      attr_reader :type, :filename
  56      def initialize(type, filename)
  57        @type, @filename = type, filename
  58        super "can not load translations from #{filename}, the file type #{type} is not known"
  59      end
  60    end
  61  en