Fix auto detect language for translate service (#19244)
This commit is contained in:
parent
2635c8dc5c
commit
d86dd067ce
4 changed files with 11 additions and 3 deletions
|
@ -28,7 +28,7 @@ class TranslationService::DeepL < TranslationService
|
|||
private
|
||||
|
||||
def request(text, source_language, target_language)
|
||||
req = Request.new(:post, endpoint_url, form: { text: text, source_lang: source_language.upcase, target_lang: target_language, tag_handling: 'html' })
|
||||
req = Request.new(:post, endpoint_url, form: { text: text, source_lang: source_language&.upcase, target_lang: target_language, tag_handling: 'html' })
|
||||
req.add_headers('Authorization': "DeepL-Auth-Key #{@api_key}")
|
||||
req
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue