2
class ArgumentError < ::ArgumentError; end
4
class InvalidLocale < ArgumentError
8
super "#{locale.inspect} is not a valid locale"
12
class MissingTranslationData < ArgumentError
13
attr_reader :locale, :key, :options
14
def initialize(locale, key, options)
15
@key, @locale, @options = key, locale, options
16
keys = I18n.send(:normalize_translation_keys, locale, key, options[:scope])
17
keys << 'no key' if keys.size < 2
18
super "translation missing: #{keys.join(', ')}"
22
class InvalidPluralizationData < ArgumentError
23
attr_reader :entry, :count
24
def initialize(entry, count)
25
@entry, @count = entry, count
26
super "translation data #{entry.inspect} can not be used with :count => #{count}"
30
class MissingInterpolationArgument < ArgumentError
31
attr_reader :key, :string
32
def initialize(key, string)
33
@key, @string = key, string
34
super "interpolation argument #{key} missing in #{string.inspect}"
38
class ReservedInterpolationKey < ArgumentError
39
attr_reader :key, :string
40
def initialize(key, string)
41
@key, @string = key, string
42
super "reserved key #{key.inspect} used in #{string.inspect}"
46
class UnknownFileType < ArgumentError
47
attr_reader :type, :filename
48
def initialize(type, filename)
49
@type, @filename = type, filename
50
super "can not load translations from #{filename}, the file type #{type} is not known"
b'\\ No newline at end of file'