Module: Gaigo::I18nExtend::TryTranslate::ClassMethods
- Defined in:
- lib/gaigo/i18n_extend/try_translate.rb
Instance Method Summary collapse
Instance Method Details
#try_translate(*args, &block) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/gaigo/i18n_extend/try_translate.rb', line 8 def try_translate(*args, &block) = args.last.is_a?(Hash) ? args.pop : {} locale = .delete(:locale) || config.locale begin translate!(*args, .merge(:locale => locale)) rescue Exception if block_given? yield args, end translate(*args, ) end end |