Add files via upload

This commit is contained in:
sienori 2017-09-25 21:04:53 +09:00 committed by GitHub
parent e2462d9117
commit f66f9ed5ce
9 changed files with 37 additions and 20 deletions

View file

@ -12,7 +12,7 @@
"message": "Translate this page" "message": "Translate this page"
}, },
"LangListLabel":{ "LangListLabel":{
"message":"Destination language" "message":"Target language"
}, },
"langList":{ "langList":{
"message":"<option value=\"is\">Icelandic</option><option value=\"ga\">Irish</option><option value=\"az\">Azerbaijani</option><option value=\"af\">Afrikaans</option><option value=\"am\">Amharic</option><option value=\"ar\">Arabic</option><option value=\"sq\">Albanian</option><option value=\"hy\">Armenian</option><option value=\"it\">Italian</option><option value=\"yi\">Yiddish</option><option value=\"ig\">Igbo</option><option value=\"id\">Indonesian</option><option value=\"cy\">Welsh</option><option value=\"uk\">Ukrainian</option><option value=\"uz\">Uzbek</option><option value=\"ur\">Urdu</option><option value=\"et\">Estonian</option><option value=\"eo\">Esperanto</option><option value=\"nl\">Dutch</option><option value=\"kk\">Kazakh</option><option value=\"ca\">Catalan</option><option value=\"gl\">Galician</option><option value=\"kn\">Kannada</option><option value=\"el\">Greek language</option><option value=\"ky\">Kirghiz</option><option value=\"gu\">Gujarati</option><option value=\"km\">Khmer</option><option value=\"ku\">Kurdish</option><option value=\"hr\">Croatian</option><option value=\"xh\">Xosa</option><option value=\"co\">Corsican</option><option value=\"sm\">Samoan</option><option value=\"jv\">Javanese</option><option value=\"ka\">Georgian</option><option value=\"sn\">Shona</option><option value=\"sd\">Sindhi</option><option value=\"si\">Sinhala</option><option value=\"sv\">Swedish</option><option value=\"zu\">Zulu</option><option value=\"gd\">Scottish Gaelic</option><option value=\"es\">Spanish</option><option value=\"sk\">Slovak</option><option value=\"sl\">Slovenian</option><option value=\"sw\">Swahili</option><option value=\"su\">Sundanese</option><option value=\"ceb\">Cebuano</option><option value=\"sr\">Serbian</option><option value=\"sx\">Sotho</option><option value=\"so\">Somali</option><option value=\"th\">Thai</option><option value=\"tl\">Tagalog</option><option value=\"tg\">Tajiki</option><option value=\"ta\">Tamil</option><option value=\"cs\">Czech</option><option value=\"ny\">Chewa</option><option value=\"te\">Telugu</option><option value=\"da\">Danish</option><option value=\"de\">German</option><option value=\"tr\">Turkish</option><option value=\"ne\">Nepali</option><option value=\"no\">Norwegian</option><option value=\"ht\">Haitian</option><option value=\"ha\">Hausa</option><option value=\"ps\">Pushto</option><option value=\"eu\">Basque</option><option value=\"haw\">Hawaiian</option><option value=\"hu\">Hungarian</option><option value=\"pa\">Punjabi</option><option value=\"hi\">Hindi</option><option value=\"fi\">Finnish</option><option value=\"fr\">French</option><option value=\"fy\">Frisian</option><option value=\"bg\">Bulgarian</option><option value=\"vi\">Vietnamese</option><option value=\"he\">Hebrew</option><option value=\"be\">Belarusian</option><option value=\"fa\">Persian</option><option value=\"bn\">Bengali</option><option value=\"pl\">Polish</option><option value=\"bs\">Bosnian</option><option value=\"pt\">Portuguese</option><option value=\"mi\">Maori</option><option value=\"mk\">Macedonian</option><option value=\"mr\">Marathi</option><option value=\"mg\">Malagasy</option><option value=\"ml\">Malayalam</option><option value=\"mt\">Maltese</option><option value=\"ms\">Malay</option><option value=\"my\">Myanmar</option><option value=\"mn\">Mongolian</option><option value=\"hmn\">Monk</option><option value=\"yo\">Yoruba</option><option value=\"lo\">Laotian</option><option value=\"la\">Latin</option><option value=\"lv\">Latvian</option><option value=\"lt\">Lithuanian</option><option value=\"ro\">Romanian</option><option value=\"lb\">Luxembourgish</option><option value=\"ru\">Russian</option><option value=\"en\">English</option><option value=\"ko\">Korean</option><option value=\"zh-CN\">Chinese (PRC)</option><option value=\"zh-TW\">Chinese (Taiwan)</option><option value=\"ja\">Japanese</option>" "message":"<option value=\"is\">Icelandic</option><option value=\"ga\">Irish</option><option value=\"az\">Azerbaijani</option><option value=\"af\">Afrikaans</option><option value=\"am\">Amharic</option><option value=\"ar\">Arabic</option><option value=\"sq\">Albanian</option><option value=\"hy\">Armenian</option><option value=\"it\">Italian</option><option value=\"yi\">Yiddish</option><option value=\"ig\">Igbo</option><option value=\"id\">Indonesian</option><option value=\"cy\">Welsh</option><option value=\"uk\">Ukrainian</option><option value=\"uz\">Uzbek</option><option value=\"ur\">Urdu</option><option value=\"et\">Estonian</option><option value=\"eo\">Esperanto</option><option value=\"nl\">Dutch</option><option value=\"kk\">Kazakh</option><option value=\"ca\">Catalan</option><option value=\"gl\">Galician</option><option value=\"kn\">Kannada</option><option value=\"el\">Greek language</option><option value=\"ky\">Kirghiz</option><option value=\"gu\">Gujarati</option><option value=\"km\">Khmer</option><option value=\"ku\">Kurdish</option><option value=\"hr\">Croatian</option><option value=\"xh\">Xosa</option><option value=\"co\">Corsican</option><option value=\"sm\">Samoan</option><option value=\"jv\">Javanese</option><option value=\"ka\">Georgian</option><option value=\"sn\">Shona</option><option value=\"sd\">Sindhi</option><option value=\"si\">Sinhala</option><option value=\"sv\">Swedish</option><option value=\"zu\">Zulu</option><option value=\"gd\">Scottish Gaelic</option><option value=\"es\">Spanish</option><option value=\"sk\">Slovak</option><option value=\"sl\">Slovenian</option><option value=\"sw\">Swahili</option><option value=\"su\">Sundanese</option><option value=\"ceb\">Cebuano</option><option value=\"sr\">Serbian</option><option value=\"sx\">Sotho</option><option value=\"so\">Somali</option><option value=\"th\">Thai</option><option value=\"tl\">Tagalog</option><option value=\"tg\">Tajiki</option><option value=\"ta\">Tamil</option><option value=\"cs\">Czech</option><option value=\"ny\">Chewa</option><option value=\"te\">Telugu</option><option value=\"da\">Danish</option><option value=\"de\">German</option><option value=\"tr\">Turkish</option><option value=\"ne\">Nepali</option><option value=\"no\">Norwegian</option><option value=\"ht\">Haitian</option><option value=\"ha\">Hausa</option><option value=\"ps\">Pushto</option><option value=\"eu\">Basque</option><option value=\"haw\">Hawaiian</option><option value=\"hu\">Hungarian</option><option value=\"pa\">Punjabi</option><option value=\"hi\">Hindi</option><option value=\"fi\">Finnish</option><option value=\"fr\">French</option><option value=\"fy\">Frisian</option><option value=\"bg\">Bulgarian</option><option value=\"vi\">Vietnamese</option><option value=\"he\">Hebrew</option><option value=\"be\">Belarusian</option><option value=\"fa\">Persian</option><option value=\"bn\">Bengali</option><option value=\"pl\">Polish</option><option value=\"bs\">Bosnian</option><option value=\"pt\">Portuguese</option><option value=\"mi\">Maori</option><option value=\"mk\">Macedonian</option><option value=\"mr\">Marathi</option><option value=\"mg\">Malagasy</option><option value=\"ml\">Malayalam</option><option value=\"mt\">Maltese</option><option value=\"ms\">Malay</option><option value=\"my\">Myanmar</option><option value=\"mn\">Mongolian</option><option value=\"hmn\">Monk</option><option value=\"yo\">Yoruba</option><option value=\"lo\">Laotian</option><option value=\"la\">Latin</option><option value=\"lv\">Latvian</option><option value=\"lt\">Lithuanian</option><option value=\"ro\">Romanian</option><option value=\"lb\">Luxembourgish</option><option value=\"ru\">Russian</option><option value=\"en\">English</option><option value=\"ko\">Korean</option><option value=\"zh-CN\">Chinese (PRC)</option><option value=\"zh-TW\">Chinese (Taiwan)</option><option value=\"ja\">Japanese</option>"
@ -21,9 +21,18 @@
"message": "Pop up a button when selecting text" "message": "Pop up a button when selecting text"
}, },
"ifCheckLangLabel":{ "ifCheckLangLabel":{
"message": "Do not display the button if the selected text is the same as the destination language" "message": "Do not display the button if the selected text is the same as the target language"
}, },
"ifShowMenuLabel":{ "ifShowMenuLabel":{
"message": "Display context menu" "message": "Display context menu"
},
"translatePageMenu":{
"message": "Translate this page"
},
"translateTextMenu":{
"message": "Translate selected text"
},
"translateLinkMenu":{
"message": "Translate selected link"
} }
} }

View file

@ -3,7 +3,7 @@
"message": "Simple Translate" "message": "Simple Translate"
}, },
"extDescription": { "extDescription": {
"message": "シンプルな翻訳を表示するツールです。" "message": "シンプルな翻訳を表示するアドオンです。"
}, },
"initialTextArea":{ "initialTextArea":{
"message": "テキストを入力" "message": "テキストを入力"
@ -25,5 +25,14 @@
}, },
"ifShowMenuLabel":{ "ifShowMenuLabel":{
"message": "コンテキストメニューを表示する" "message": "コンテキストメニューを表示する"
},
"translatePageMenu":{
"message": "ページ全体を翻訳"
},
"translateTextMenu":{
"message": "選択したテキストを翻訳"
},
"translateLinkMenu":{
"message": "選択したリンクを翻訳"
} }
} }

View file

@ -14,7 +14,7 @@ function getSetting() {
}); });
} }
//設定の初期化 動く? //設定の初期化
function initialSetting() { function initialSetting() {
switch (browser.i18n.getUILanguage()) { //一部の言語はブラウザの設定に合わせる switch (browser.i18n.getUILanguage()) { //一部の言語はブラウザの設定に合わせる
case "ja": case "ja":
@ -39,21 +39,21 @@ function initialSetting() {
//メニューを表示 //メニューを表示
function menuCreate() { function menuCreate() {
browser.contextMenus.create({
id: "translateText",
title: "選択したテキストを翻訳",
contexts: ["selection"],
});
browser.contextMenus.create({ browser.contextMenus.create({
id: "translatePage", id: "translatePage",
title: "ページ全体を翻訳", title: browser.i18n.getMessage("translatePageMenu"),
contexts: ["all"], contexts: ["all"],
}); });
browser.contextMenus.create({
id: "translateText",
title: browser.i18n.getMessage("translateTextMenu"),
contexts: ["selection"],
});
browser.contextMenus.create({ browser.contextMenus.create({
id: "translateLink", id: "translateLink",
title: "選択したリンクを翻訳", title: browser.i18n.getMessage("translateLinkMenu"),
contexts: ["link"], contexts: ["link"],
}); });
} }
@ -67,12 +67,12 @@ function menuRemove() {
//メニュークリック時 //メニュークリック時
browser.contextMenus.onClicked.addListener(function (info, tab) { browser.contextMenus.onClicked.addListener(function (info, tab) {
switch (info.menuItemId) { switch (info.menuItemId) {
case "translateText":
translateTextMenu(info, tab);
break;
case "translatePage": case "translatePage":
translatePageMenu(info, tab); translatePageMenu(info, tab);
break; break;
case "translateText":
translateTextMenu(info, tab);
break;
case "translateLink": case "translateLink":
translateLinkMenu(info, tab); translateLinkMenu(info, tab);
break; break;

View file

@ -1,7 +1,7 @@
{ {
"manifest_version": 2, "manifest_version": 2,
"version": "1.0", "version": "1.1.1",
"name": "__MSG_extName__", "name": "__MSG_extName__",
"description": "__MSG_extDescription__", "description": "__MSG_extDescription__",

View file

@ -24,8 +24,7 @@ function getTargetLang() {
function changeLang() { function changeLang() {
targetLang = langList.value; targetLang = langList.value;
if (sourceWord !== "") { if (sourceWord !== "") {
removeResult(); translate();
splitLine();
} }
if (url !== "") showLink(); if (url !== "") showLink();
} }

View file

@ -8,7 +8,7 @@
height: 22px; height: 22px;
width: 22px; width: 22px;
position: fixed; position: fixed;
z-index: 10002; z-index: 2147483647;
left: 0px; left: 0px;
top: 0px; top: 0px;
display: none; display: none;
@ -34,7 +34,7 @@
width:300px;/*消すかも*/ width:300px;/*消すかも*/
position: fixed; position: fixed;
padding: 10px 18px; padding: 10px 18px;
z-index: 10001; z-index: 2147483646;
left: 0px; left: 0px;
top: 0px; top: 0px;
display: none; display: none;