Module: BMC::ModelI18n

Extended by:
ActiveSupport::Concern
Included in:
Email
Defined in:
app/models/concerns/bmc/model_i18n.rb

Constant Summary collapse

MissingTranslationError =
Class.new(StandardError)

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.raise_on_missing_translationsObject

Returns the value of attribute raise_on_missing_translations.



6
7
8
# File 'app/models/concerns/bmc/model_i18n.rb', line 6

def raise_on_missing_translations
  @raise_on_missing_translations
end

Instance Method Details

#tObject



10
11
12
# File 'app/models/concerns/bmc/model_i18n.rb', line 10

def t(...)
  self.class.t(...)
end

#tsObject



14
15
16
# File 'app/models/concerns/bmc/model_i18n.rb', line 14

def ts
  self.class.ts
end

#tv(attribute) ⇒ Object



18
19
20
21
# File 'app/models/concerns/bmc/model_i18n.rb', line 18

def tv(attribute)
  value = public_send(attribute)
  t("#{attribute}.#{value}") if value.present?
end