Sha256: 30386549365a9e9a113887f63d27a227262ed80b9c668b0a0f4f90052ddc72f8
Contents?: true
Size: 866 Bytes
Versions: 7
Compression:
Stored size: 866 Bytes
Contents
# frozen_string_literal: true module Decidim module Dev # This Dummy translator receives the field value # and the locale of the field which has to be # translated. It returns the appended value for both. # This is for testing only. class DummyTranslator attr_reader :text, :source_locale, :target_locale, :resource, :field_name def initialize(resource, field_name, text, target_locale, source_locale) @resource = resource @field_name = field_name @text = text @target_locale = target_locale @source_locale = source_locale end def translate translated_text = "#{target_locale} - #{text}" MachineTranslationSaveJob.perform_later( resource, field_name, target_locale, translated_text ) end end end end
Version data entries
7 entries across 7 versions & 1 rubygems