Sha256: f9c6c360c3b1bbb4a4de42834c542cab37d567df6e78844deddec68d31cae614

Contents?: true

Size: 321 Bytes

Versions: 8

Compression:

Stored size: 321 Bytes

Contents

module HyperI18n
  class Translate < Hyperloop::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

8 entries across 8 versions & 1 rubygems

Version Path
hyper-i18n-0.99.6 lib/hyper-i18n/operations/translate.rb
hyper-i18n-0.99.5 lib/hyper-i18n/operations/translate.rb
hyper-i18n-0.99.4 lib/hyper-i18n/operations/translate.rb
hyper-i18n-0.99.3 lib/hyper-i18n/operations/translate.rb
hyper-i18n-0.99.2 lib/hyper-i18n/operations/translate.rb
hyper-i18n-0.99.1 lib/hyper-i18n/operations/translate.rb
hyper-i18n-0.99.0 lib/hyper-i18n/operations/translate.rb
hyper-i18n-0.1.1 lib/hyper-i18n/operations/translate.rb