module I18n::Tasks::Translation
Public Instance Methods
Source
# 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
@param [I18n::Tasks::Tree::Siblings] forest to translate to the locales of its root nodes @param [String] from locale @param [:deepl, :openai, :google, :yandex] backend @return [I18n::Tasks::Tree::Siblings] translated forest