Skip to content

Commit

Permalink
Bing: Change target langauge to english if source language is Chinese
Browse files Browse the repository at this point in the history
  • Loading branch information
zw963 committed Apr 12, 2024
1 parent aa05d11 commit 155d571
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/translater/bing.cr
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class Translater
if target_language.chinese? && language_selector_ele.text != "Chinese Simplified"
# 如果输入内容是英文, 修改目标语言为中文
document_manager.execute_script(%{select = document.querySelector("#{language_selector}"); select.value = "zh-Hans"})
elsif target_language.english? && language_selector_ele.text != "English"
document_manager.execute_script(%{select = document.querySelector("#{language_selector}"); select.value = "en"})
end

input_ele.click
Expand Down

0 comments on commit 155d571

Please sign in to comment.