diff options
author | Yamagishi Kazutoshi <ykzts@desire.sh> | 2022-09-28 06:33:56 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-27 23:33:56 +0200 |
commit | d86dd067ceb1dc05e67417fa1d7f1e84519b2fca (patch) | |
tree | b86422f5ad9375daaf76b1c7f79f0d309802818f /app/lib/translation_service/deepl.rb | |
parent | 2635c8dc5c19ea976b9fc787169244d7e8cec90a (diff) |
Fix auto detect language for translate service (#19244)
Diffstat (limited to 'app/lib/translation_service/deepl.rb')
-rw-r--r-- | app/lib/translation_service/deepl.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/lib/translation_service/deepl.rb b/app/lib/translation_service/deepl.rb index 89ccf01e5..b75b604a8 100644 --- a/app/lib/translation_service/deepl.rb +++ b/app/lib/translation_service/deepl.rb @@ -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 |