Exception: Clickwrap::MissingTranslation

Inherits:
DefinitionError show all
Defined in:
lib/clickwrap/localized_text.rb

Overview

Raised when a required human-facing string has no text for the requested locale. Clickwrap will not present a legal statement in a language the policy did not declare, and will not record one it could not render.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key:, locale:) ⇒ MissingTranslation

Returns a new instance of MissingTranslation.



92
93
94
95
96
97
98
99
# File 'lib/clickwrap/localized_text.rb', line 92

def initialize(key:, locale:)
  @key = key
  @locale = locale
  super(
    "No text for #{key.inspect} in locale #{locale.inspect}. Add the translation, or " \
    "restrict the policy to the locales it can actually present."
  )
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



90
91
92
# File 'lib/clickwrap/localized_text.rb', line 90

def key
  @key
end

#localeObject (readonly)

Returns the value of attribute locale.



90
91
92
# File 'lib/clickwrap/localized_text.rb', line 90

def locale
  @locale
end