Module: SmoothOperator::Translation::HelperMethods
- Extended by:
- HelperMethods
- Included in:
- HelperMethods
- Defined in:
- lib/smooth_operator/translation.rb
Instance Method Summary collapse
Instance Method Details
#translate(namespace = '', options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/smooth_operator/translation.rb', line 15 def translate(namespace = '', = {}) no_translation = "-- no translation --" defaults = ["smooth_operator.#{namespace}".to_sym] defaults << "activerecord.#{namespace}".to_sym defaults << [:default] if [:default] defaults.flatten! defaults << no_translation = { count: 1, default: defaults } .merge!(.except(:default)) I18n.translate(defaults.shift, ) end |