Sha256: 7bc8f3407f6c40b684dccdfd97afb8b1975c00488b465672d21232e28986021c

Contents?: true

Size: 322 Bytes

Versions: 7

Compression:

Stored size: 322 Bytes

Contents

module HyperI18n
  class Translate < Hyperstack::ServerOp
    param :acting_user, nils: true
    param :attribute
    param :opts
    param :translation, default: nil

    def opts
      params.opts.with_indifferent_access
    end

    step do
      params.translation = ::I18n.t(params.attribute, opts)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hyper-i18n-1.0.alpha1.4 lib/hyper-i18n/operations/translate.rb
hyper-i18n-1.0.alpha1.3 lib/hyper-i18n/operations/translate.rb
hyper-i18n-1.0.alpha1.2 lib/hyper-i18n/operations/translate.rb
hyper-i18n-1.0.alpha1.1 lib/hyper-i18n/operations/translate.rb
hyper-i18n-1.0.0.pre.alpha1 lib/hyper-i18n/operations/translate.rb
hyper-i18n-1.0.alpha1 lib/hyper-i18n/operations/translate.rb
hyper-i18n-1.0.pre.alpha1 lib/hyper-i18n/operations/translate.rb