Exception: Lazier::Exceptions::MissingTranslation

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/lazier/exceptions.rb

Overview

This exception is raised from I18n if a string is not translatable.

Instance Method Summary collapse

Constructor Details

#initialize(locale, message = nil) ⇒ MissingTranslation

Creates a new missing translation exception.

Parameters:

  • locale (Array)

    The locale that was requested to use.

  • message (String|NilClass) (defaults to: nil)

    The message that was requested to translate.



32
33
34
35
# File 'lib/lazier/exceptions.rb', line 32

def initialize(locale, message = nil)
  locale, message = locale if message.nil?
  super("Unable to load the translation \"#{message}\" for the locale \"#{locale}\".")
end