Module: I18n::Tasks::Translation
- Included in:
- BaseTask
- Defined in:
- lib/i18n/tasks/translation.rb
Instance Method Summary collapse
-
#translate_forest(forest, from:, backend:) ⇒ I18n::Tasks::Tree::Siblings
Translated forest.
Instance Method Details
#translate_forest(forest, from:, backend:) ⇒ I18n::Tasks::Tree::Siblings
Returns translated forest.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/i18n/tasks/translation.rb', line 15 def translate_forest(forest, from:, backend:) case backend when :deepl Translators::DeeplTranslator.new(self).translate_forest(forest, from) when :google Translators::GoogleTranslator.new(self).translate_forest(forest, from) when :openai Translators::OpenAiTranslator.new(self).translate_forest(forest, from) when :watsonx Translators::WatsonxTranslator.new(self).translate_forest(forest, from) when :yandex Translators::YandexTranslator.new(self).translate_forest(forest, from) else fail CommandError, "invalid backend: #{backend}" end end |