lib/translate_self/translation.rb in translate_self-0.3.0 vs lib/translate_self/translation.rb in translate_self-0.4.0
- old
+ new
@@ -50,8 +50,10 @@
def call_deepl(text, language = self.language, to_lan = to_language)
warn 'No language given!' and return if to_lan.nil?
response = DeepL.translate text, language, to_lan
self.language = response.detected_source_language.downcase if self.language.nil?
- response.text
+ actual_translation = response.text
+ actual_translation.language = to_lan
+ actual_translation
end
end