Initialize default target language
This commit is contained in:
parent
9aa510f901
commit
aeb715a356
|
@ -24,23 +24,6 @@ function showMenu() {
|
|||
} else menuRemove();
|
||||
}
|
||||
|
||||
function initialSetting() {
|
||||
switch (browser.i18n.getUILanguage()) { //一部の言語はブラウザの設定に合わせる
|
||||
case "ja":
|
||||
case "zh-CN":
|
||||
case "zh-TW":
|
||||
case "ko":
|
||||
case "ru":
|
||||
targetLang = browser.i18n.getUILanguage();
|
||||
secondTargetLang = "en";
|
||||
break;
|
||||
default:
|
||||
targetLang = "en";
|
||||
secondTargetLang = "ja";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//メニューを表示
|
||||
function menuCreate() {
|
||||
browser.contextMenus.create({
|
||||
|
|
|
@ -23,6 +23,7 @@ function setLangList() {
|
|||
targetLang.innerHTML = langListHtml;
|
||||
secondTargetLang.innerHTML = langListHtml;
|
||||
|
||||
initialSetting();
|
||||
}
|
||||
|
||||
function alphabeticallySort(a, b) {
|
||||
|
@ -33,6 +34,26 @@ function alphabeticallySort(a, b) {
|
|||
}
|
||||
}
|
||||
|
||||
function initialSetting() {
|
||||
switch (browser.i18n.getUILanguage()) { //一部の言語はブラウザの設定に合わせる
|
||||
case "ja":
|
||||
case "zh-CN":
|
||||
case "zh-TW":
|
||||
case "ko":
|
||||
case "ru":
|
||||
case "de":
|
||||
case "fr":
|
||||
case "it":
|
||||
targetLang.value = browser.i18n.getUILanguage();
|
||||
secondTargetLang.value = "en";
|
||||
break;
|
||||
default:
|
||||
targetLang.value = "en";
|
||||
secondTargetLang.value = "ja";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
S.initOptionsPage().then(function () {
|
||||
const saveByChangeItems = document.getElementsByClassName("saveByChange");
|
||||
for (let item of saveByChangeItems) {
|
||||
|
|
Loading…
Reference in a new issue