Module: SgtnClient::Fallbacks
- Included in:
- Translation
- Defined in:
- lib/sgtn-client/fallbacks.rb
Overview
:nodoc:
Instance Method Summary collapse
- #get_translation!(key, component, locale) ⇒ Object
- #get_translations!(component, locale = nil) ⇒ Object
Instance Method Details
#get_translation!(key, component, locale) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/sgtn-client/fallbacks.rb', line 6 def get_translation!(key, component, locale) error = nil localechain(locale) do |l| return super(key, component, l) rescue StandardError => e error = e end raise error if error end |
#get_translations!(component, locale = nil) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/sgtn-client/fallbacks.rb', line 16 def get_translations!(component, locale = nil) error = nil localechain(locale) do |l| result = super(component, l) return result if result rescue StandardError => e error = e end raise error if error end |