Skip to content

Commit

Permalink
Definir serviço de tradução como bing se o idioma do navegador for zh-CN
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipePS committed Apr 17, 2023
1 parent 4e03f6f commit 4edda10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/options/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ twpConfig.onReady(function () {

if (hash === "#release_notes") {
$("#btnPatreon").style.display = "none";
if (chrome.i18n.getUILanguage() === "zh-CN") {
setTimeout(() => {
alert("现在 Bing 翻译服务可用于页面翻译。\n因为你的浏览器语言是简体中文,我相信你在中国大陆,你无法使用谷歌翻译进行翻译,所以翻译服务设置为Bing。")
twpConfig.set("pageTranslatorService", "bing")
twpConfig.set("textTranslatorService", "bing")
}, 50)
}
} else {
$("#btnPatreon").style.display = "block";
}
Expand Down
1 change: 1 addition & 0 deletions src/options/release-notes/en.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ <h4>9.7</h4>
<ul>
<li>Added:
<ul>
<li>Bing as a page translation service.</li>
<li>Custom dictionary in site settings.</li>
<li>Option to change target language and favorite languages in setting page.</li>
<li>Checkbox to disable translate selected text button in simple interface.</li>
Expand Down

0 comments on commit 4edda10

Please sign in to comment.