Class: Postnhost::Translation::ContentTranslator

Inherits:
BaseService
  • Object
show all
Defined in:
app/services/postnhost/translation/content_translator.rb

Instance Method Summary collapse

Methods inherited from BaseService

call

Constructor Details

#initialize(source:, language:, llm_client:) ⇒ ContentTranslator

Returns a new instance of ContentTranslator.



4
5
6
7
8
# File 'app/services/postnhost/translation/content_translator.rb', line 4

def initialize(source:, language:, llm_client:)
  @source = source
  @language = language
  @llm_client = llm_client
end

Instance Method Details

#callObject



10
11
12
13
14
15
16
17
18
# File 'app/services/postnhost/translation/content_translator.rb', line 10

def call
  {
    title: translate_title,
    title_tag: translate_title_tag,
    og_title: translate_og_title,
    meta_description: translate_meta_description,
    content: translate_body
  }
end