Module: Mumukit::Inspection::I18n

Defined in:
lib/mumukit/inspection/i18n.rb

Constant Summary collapse

DEFAULT_KEYWORDS =
{
  keyword_null: :null,
  keyword_if: :if,
  keyword_is: :is,
  keyword_fail: :fail,
  keyword_findall: :findall,
  keyword_forall: :forall,
  keyword_foreach: :foreach,
  keyword_not: :not,
  keyword_repeat: :repeat,
  keyword_switch: :switch,
  keyword_while: :while,
}

Class Method Summary collapse

Class Method Details

.translate(e, keywords = nil) ⇒ Object Also known as: t


17
18
19
20
21
22
23
# File 'lib/mumukit/inspection/i18n.rb', line 17

def translate(e, keywords = nil)
  e = e.as_v2
  key = key_for e.binding, e.inspection
  ::I18n.t key, translation_params(e, keywords)
rescue
  '<unknown expectation>'
end