浏览代码

added i18n support for search box

Gerald 12 年之前
父节点
当前提交
0d2f16b084

+ 25 - 9
_locales/cs/messages.json

@@ -21,7 +21,7 @@
 	}, 
 	"msgErrorFetchingScript": {
 		"message": "Chyba při načítání skritpu!", 
-		"description": "Message shown when Violentmonkey failed fetching a new version of the script."
+		"description": "Message shown when Violentmonkey fails fetching a new version of the script."
 	}, 
 	"msgInstalled": {
 		"message": "Skript nainstalován.", 
@@ -41,7 +41,7 @@
 	}, 
 	"msgErrorFetchingUpdateInfo": {
 		"message": "Načtení informací o aktualizaci se nezdařilo.", 
-		"description": "Message shown when Violentmonkey failed fetching version data of the script."
+		"description": "Message shown when Violentmonkey fails fetching version data of the script."
 	}, 
 	"msgNoUpdate": {
 		"message": "Aktualizace nenalezena.", 
@@ -117,7 +117,7 @@
 	}, 
 	"labelShowDetails": {
 		"message": "Zobrazit detaily", 
-		"description": "An option to show the details of scripts, such as author, description, etc."
+		"description": "Option to show the details of scripts, such as author, description, etc."
 	}, 
 	"msgLoading": {
 		"message": "Nahrávám ...", 
@@ -133,7 +133,7 @@
 	}, 
 	"labelAllowUpdate": {
 		"message": "Povolit aktualizace", 
-		"description": "An option to allow checking updates for a script."
+		"description": "Option to allow checking updates for a script."
 	}, 
 	"buttonSave": {
 		"message": "Uložit", 
@@ -173,7 +173,7 @@
 	}, 
 	"labelKeepInclude": {
 		"message": "Dodržovat originální zahrnutí", 
-		"description": "An option to keep the original @include rules."
+		"description": "Option to keep the original @include rules."
 	}, 
 	"labelCustomInclude": {
 		"message": "Vlastní pravidla pro zahrnování: <em>(Jedno na řádek)</em>", 
@@ -185,7 +185,7 @@
 	}, 
 	"labelKeepMatch": {
 		"message": "Dodržovat originální přiřazení", 
-		"description": "An option to keep the original @match rules."
+		"description": "Option to keep the original @match rules."
 	}, 
 	"labelCustomMatch": {
 		"message": "Vlastní pravidla pro přiřazení: <em>(Jedno na řádek)</em>", 
@@ -197,7 +197,7 @@
 	}, 
 	"labelKeepExclude": {
 		"message": "Dodržovat originální výjimky", 
-		"description": "An option to keep the original @exclude rules."
+		"description": "Option to keep the original @exclude rules."
 	}, 
 	"labelCustomExclude": {
 		"message": "Vlastní pravidla pro výjimky: <em>(Jedno na řádek)</em>", 
@@ -221,7 +221,7 @@
 	}, 
 	"labelExportScriptData": {
 		"message": "Export data skriptu", 
-		"description": "An option to export script data along with scripts."
+		"description": "Option to export script data along with scripts."
 	}, 
 	"buttonAllNone": {
 		"message": "Vše/Žádný", 
@@ -233,7 +233,7 @@
 	}, 
 	"labelAutoUpdate": {
 		"message": "Automaticky kontrolovat aktualizace skriptu každý den", 
-		"description": "An option to allow automatically checking scripts for updates every 24 hours."
+		"description": "Option to allow automatically checking scripts for updates every 24 hours."
 	}, 
 	"labelSearchLink": {
 		"message": "hledat URL: ", 
@@ -338,5 +338,21 @@
 	"menuCommands": {
 		"message": "Skriptové příkazy...", 
 		"description": "Menu item to list script commands."
+	}, 
+	"labelSearch": {
+		"message": "Search for: ", 
+		"description": "Label for search input in search box."
+	}, 
+	"labelReplace": {
+		"message": "Replace with: ", 
+		"description": "Label for replace input in search box."
+	}, 
+	"buttonReplace": {
+		"message": "Replace", 
+		"description": "Button to replace the current match."
+	}, 
+	"buttonReplaceAll": {
+		"message": "All", 
+		"description": "Button to replace all matches."
 	}
 }

+ 26 - 10
_locales/en/messages.json

@@ -21,7 +21,7 @@
 	}, 
 	"msgErrorFetchingScript": {
 		"message": "Error fetching script!", 
-		"description": "Message shown when Violentmonkey failed fetching a new version of the script."
+		"description": "Message shown when Violentmonkey fails fetching a new version of the script."
 	}, 
 	"msgInstalled": {
 		"message": "Script installed.", 
@@ -41,7 +41,7 @@
 	}, 
 	"msgErrorFetchingUpdateInfo": {
 		"message": "Failed fetching update information.", 
-		"description": "Message shown when Violentmonkey failed fetching version data of the script."
+		"description": "Message shown when Violentmonkey fails fetching version data of the script."
 	}, 
 	"msgNoUpdate": {
 		"message": "No update found.", 
@@ -68,7 +68,7 @@
 		"description": "Button to close window."
 	}, 
 	"anchorSupportPage": {
-		"message": "<a href=https://github.com/gera2ld/Violentmonkey/wiki target=_blank>Violentmonkey</a>", 
+		"message": "<a href=https://github.com/gera2ld/Violentmonkey-oex/wiki target=_blank>Violentmonkey</a>", 
 		"description": "Link to the support page of Violentmonkey."
 	}, 
 	"anchorAuthor": {
@@ -117,7 +117,7 @@
 	}, 
 	"labelShowDetails": {
 		"message": "Show details", 
-		"description": "An option to show the details of scripts, such as author, description, etc."
+		"description": "Option to show the details of scripts, such as author, description, etc."
 	}, 
 	"msgLoading": {
 		"message": "Loading ...", 
@@ -133,7 +133,7 @@
 	}, 
 	"labelAllowUpdate": {
 		"message": "Allow update", 
-		"description": "An option to allow checking updates for a script."
+		"description": "Option to allow checking updates for a script."
 	}, 
 	"buttonSave": {
 		"message": "Save", 
@@ -173,7 +173,7 @@
 	}, 
 	"labelKeepInclude": {
 		"message": "Keep original include rules", 
-		"description": "An option to keep the original @include rules."
+		"description": "Option to keep the original @include rules."
 	}, 
 	"labelCustomInclude": {
 		"message": "Custom include rules: <em>(One per line)</em>", 
@@ -185,7 +185,7 @@
 	}, 
 	"labelKeepMatch": {
 		"message": "Keep original match rules", 
-		"description": "An option to keep the original @match rules."
+		"description": "Option to keep the original @match rules."
 	}, 
 	"labelCustomMatch": {
 		"message": "Custom match rules: <em>(One per line)</em>", 
@@ -197,7 +197,7 @@
 	}, 
 	"labelKeepExclude": {
 		"message": "Keep original exclude rules", 
-		"description": "An option to keep the original @exclude rules."
+		"description": "Option to keep the original @exclude rules."
 	}, 
 	"labelCustomExclude": {
 		"message": "Custom exclude rules: <em>(One per line)</em>", 
@@ -221,7 +221,7 @@
 	}, 
 	"labelExportScriptData": {
 		"message": "Export script data", 
-		"description": "An option to export script data along with scripts."
+		"description": "Option to export script data along with scripts."
 	}, 
 	"buttonAllNone": {
 		"message": "All/None", 
@@ -233,7 +233,7 @@
 	}, 
 	"labelAutoUpdate": {
 		"message": "Automatically check scripts for updates every day", 
-		"description": "An option to allow automatically checking scripts for updates every 24 hours."
+		"description": "Option to allow automatically checking scripts for updates every 24 hours."
 	}, 
 	"labelSearchLink": {
 		"message": "Search URL: ", 
@@ -338,5 +338,21 @@
 	"menuCommands": {
 		"message": "Script commands...", 
 		"description": "Menu item to list script commands."
+	}, 
+	"labelSearch": {
+		"message": "Search for: ", 
+		"description": "Label for search input in search box."
+	}, 
+	"labelReplace": {
+		"message": "Replace with: ", 
+		"description": "Label for replace input in search box."
+	}, 
+	"buttonReplace": {
+		"message": "Replace", 
+		"description": "Button to replace the current match."
+	}, 
+	"buttonReplaceAll": {
+		"message": "All", 
+		"description": "Button to replace all matches."
 	}
 }

+ 25 - 9
_locales/pl/messages.json

@@ -21,7 +21,7 @@
 	}, 
 	"msgErrorFetchingScript": {
 		"message": "Błąd przy pobieraniu skryptu!", 
-		"description": "Message shown when Violentmonkey failed fetching a new version of the script."
+		"description": "Message shown when Violentmonkey fails fetching a new version of the script."
 	}, 
 	"msgInstalled": {
 		"message": "Skrypt zainstalowany", 
@@ -41,7 +41,7 @@
 	}, 
 	"msgErrorFetchingUpdateInfo": {
 		"message": "Błąd pobierania informacji aktualizacji.", 
-		"description": "Message shown when Violentmonkey failed fetching version data of the script."
+		"description": "Message shown when Violentmonkey fails fetching version data of the script."
 	}, 
 	"msgNoUpdate": {
 		"message": "Nie znaleziono aktualizacji.", 
@@ -117,7 +117,7 @@
 	}, 
 	"labelShowDetails": {
 		"message": "Pokaż szczegóły", 
-		"description": "An option to show the details of scripts, such as author, description, etc."
+		"description": "Option to show the details of scripts, such as author, description, etc."
 	}, 
 	"msgLoading": {
 		"message": "Loading ...", 
@@ -133,7 +133,7 @@
 	}, 
 	"labelAllowUpdate": {
 		"message": "Zezwól na aktualizacje", 
-		"description": "An option to allow checking updates for a script."
+		"description": "Option to allow checking updates for a script."
 	}, 
 	"buttonSave": {
 		"message": "Zapisz", 
@@ -173,7 +173,7 @@
 	}, 
 	"labelKeepInclude": {
 		"message": "Zachowaj oryginalne zasady include", 
-		"description": "An option to keep the original @include rules."
+		"description": "Option to keep the original @include rules."
 	}, 
 	"labelCustomInclude": {
 		"message": "Własne zasady include: <em>(Jedna na linię)</em>", 
@@ -185,7 +185,7 @@
 	}, 
 	"labelKeepMatch": {
 		"message": "Zachowaj oryginalne zasady match", 
-		"description": "An option to keep the original @match rules."
+		"description": "Option to keep the original @match rules."
 	}, 
 	"labelCustomMatch": {
 		"message": "Własne zasady match: <em>(Jedna na linię)</em>", 
@@ -197,7 +197,7 @@
 	}, 
 	"labelKeepExclude": {
 		"message": "Zachowaj oryginalne zasady exclude", 
-		"description": "An option to keep the original @exclude rules."
+		"description": "Option to keep the original @exclude rules."
 	}, 
 	"labelCustomExclude": {
 		"message": "Własne zasady exclude: <em>(Jedna na linię)</em>", 
@@ -221,7 +221,7 @@
 	}, 
 	"labelExportScriptData": {
 		"message": "Eksportuj dane skryptu", 
-		"description": "An option to export script data along with scripts."
+		"description": "Option to export script data along with scripts."
 	}, 
 	"buttonAllNone": {
 		"message": "Wszystkie/Żaden", 
@@ -233,7 +233,7 @@
 	}, 
 	"labelAutoUpdate": {
 		"message": "Automatycznie sprawdzaj aktualizacje dla skryptów każdego dnia", 
-		"description": "An option to allow automatically checking scripts for updates every 24 hours."
+		"description": "Option to allow automatically checking scripts for updates every 24 hours."
 	}, 
 	"labelSearchLink": {
 		"message": "Adres wyszukiwarki:", 
@@ -338,5 +338,21 @@
 	"menuCommands": {
 		"message": "Komendy skryptu...", 
 		"description": "Menu item to list script commands."
+	}, 
+	"labelSearch": {
+		"message": "Search for: ", 
+		"description": "Label for search input in search box."
+	}, 
+	"labelReplace": {
+		"message": "Replace with: ", 
+		"description": "Label for replace input in search box."
+	}, 
+	"buttonReplace": {
+		"message": "Replace", 
+		"description": "Button to replace the current match."
+	}, 
+	"buttonReplaceAll": {
+		"message": "All", 
+		"description": "Button to replace all matches."
 	}
 }

+ 25 - 9
_locales/ru/messages.json

@@ -21,7 +21,7 @@
 	}, 
 	"msgErrorFetchingScript": {
 		"message": "Ошибка чтения скрипта!", 
-		"description": "Message shown when Violentmonkey failed fetching a new version of the script."
+		"description": "Message shown when Violentmonkey fails fetching a new version of the script."
 	}, 
 	"msgInstalled": {
 		"message": "Скрипт установлен.", 
@@ -41,7 +41,7 @@
 	}, 
 	"msgErrorFetchingUpdateInfo": {
 		"message": "Не удается найти обновления.", 
-		"description": "Message shown when Violentmonkey failed fetching version data of the script."
+		"description": "Message shown when Violentmonkey fails fetching version data of the script."
 	}, 
 	"msgNoUpdate": {
 		"message": "Обновления не найдены.", 
@@ -117,7 +117,7 @@
 	}, 
 	"labelShowDetails": {
 		"message": "Показать детали", 
-		"description": "An option to show the details of scripts, such as author, description, etc."
+		"description": "Option to show the details of scripts, such as author, description, etc."
 	}, 
 	"msgLoading": {
 		"message": "Загрузка ...", 
@@ -133,7 +133,7 @@
 	}, 
 	"labelAllowUpdate": {
 		"message": "Разрешить обновление", 
-		"description": "An option to allow checking updates for a script."
+		"description": "Option to allow checking updates for a script."
 	}, 
 	"buttonSave": {
 		"message": "Сохранить", 
@@ -173,7 +173,7 @@
 	}, 
 	"labelKeepInclude": {
 		"message": "Сохранять оригинальные правила include", 
-		"description": "An option to keep the original @include rules."
+		"description": "Option to keep the original @include rules."
 	}, 
 	"labelCustomInclude": {
 		"message": "Пользовательские правила include: <em>(По одному на строку)</em>", 
@@ -185,7 +185,7 @@
 	}, 
 	"labelKeepMatch": {
 		"message": "Сохранять оригинальные правила match", 
-		"description": "An option to keep the original @match rules."
+		"description": "Option to keep the original @match rules."
 	}, 
 	"labelCustomMatch": {
 		"message": "Пользовательские правила match: <em>(По одному на строку)</em>", 
@@ -197,7 +197,7 @@
 	}, 
 	"labelKeepExclude": {
 		"message": "Сохранять оригинальные правила exclude", 
-		"description": "An option to keep the original @exclude rules."
+		"description": "Option to keep the original @exclude rules."
 	}, 
 	"labelCustomExclude": {
 		"message": "Пользовательские правила exclude: <em>(По одному на строку)</em>", 
@@ -221,7 +221,7 @@
 	}, 
 	"labelExportScriptData": {
 		"message": "Экспортировать данные", 
-		"description": "An option to export script data along with scripts."
+		"description": "Option to export script data along with scripts."
 	}, 
 	"buttonAllNone": {
 		"message": "Всё/Ничего", 
@@ -233,7 +233,7 @@
 	}, 
 	"labelAutoUpdate": {
 		"message": "Ежедневно проверять обновления скриптов", 
-		"description": "An option to allow automatically checking scripts for updates every 24 hours."
+		"description": "Option to allow automatically checking scripts for updates every 24 hours."
 	}, 
 	"labelSearchLink": {
 		"message": "Поисковый URL: ", 
@@ -338,5 +338,21 @@
 	"menuCommands": {
 		"message": "Команды сценария...", 
 		"description": "Menu item to list script commands."
+	}, 
+	"labelSearch": {
+		"message": "Search for: ", 
+		"description": "Label for search input in search box."
+	}, 
+	"labelReplace": {
+		"message": "Replace with: ", 
+		"description": "Label for replace input in search box."
+	}, 
+	"buttonReplace": {
+		"message": "Replace", 
+		"description": "Button to replace the current match."
+	}, 
+	"buttonReplaceAll": {
+		"message": "All", 
+		"description": "Button to replace all matches."
 	}
 }

+ 26 - 10
_locales/zh/messages.json

@@ -21,7 +21,7 @@
 	}, 
 	"msgErrorFetchingScript": {
 		"message": "获取脚本发生错误!", 
-		"description": "Message shown when Violentmonkey failed fetching a new version of the script."
+		"description": "Message shown when Violentmonkey fails fetching a new version of the script."
 	}, 
 	"msgInstalled": {
 		"message": "脚本已安装。", 
@@ -41,7 +41,7 @@
 	}, 
 	"msgErrorFetchingUpdateInfo": {
 		"message": "获取更新信息失败。", 
-		"description": "Message shown when Violentmonkey failed fetching version data of the script."
+		"description": "Message shown when Violentmonkey fails fetching version data of the script."
 	}, 
 	"msgNoUpdate": {
 		"message": "未发现新版本。", 
@@ -117,7 +117,7 @@
 	}, 
 	"labelShowDetails": {
 		"message": "显示详情", 
-		"description": "An option to show the details of scripts, such as author, description, etc."
+		"description": "Option to show the details of scripts, such as author, description, etc."
 	}, 
 	"msgLoading": {
 		"message": "加载中 ...", 
@@ -133,7 +133,7 @@
 	}, 
 	"labelAllowUpdate": {
 		"message": "允许更新", 
-		"description": "An option to allow checking updates for a script."
+		"description": "Option to allow checking updates for a script."
 	}, 
 	"buttonSave": {
 		"message": "保存", 
@@ -173,7 +173,7 @@
 	}, 
 	"labelKeepInclude": {
 		"message": "保留原有的包含规则", 
-		"description": "An option to keep the original @include rules."
+		"description": "Option to keep the original @include rules."
 	}, 
 	"labelCustomInclude": {
 		"message": "自定义包含规则:<em>(每行一个)</em>", 
@@ -185,7 +185,7 @@
 	}, 
 	"labelKeepMatch": {
 		"message": "保留原有的匹配规则", 
-		"description": "An option to keep the original @match rules."
+		"description": "Option to keep the original @match rules."
 	}, 
 	"labelCustomMatch": {
 		"message": "自定义匹配规则:<em>(每行一个)</em>", 
@@ -197,7 +197,7 @@
 	}, 
 	"labelKeepExclude": {
 		"message": "保留原有的排除规则", 
-		"description": "An option to keep the original @exclude rules."
+		"description": "Option to keep the original @exclude rules."
 	}, 
 	"labelCustomExclude": {
 		"message": "自定义排除规则:<em>(每行一个)</em>", 
@@ -221,7 +221,7 @@
 	}, 
 	"labelExportScriptData": {
 		"message": "导出脚本数据", 
-		"description": "An option to export script data along with scripts."
+		"description": "Option to export script data along with scripts."
 	}, 
 	"buttonAllNone": {
 		"message": "全选/不选", 
@@ -233,7 +233,7 @@
 	}, 
 	"labelAutoUpdate": {
 		"message": "每天自动更新脚本", 
-		"description": "An option to allow automatically checking scripts for updates every 24 hours."
+		"description": "Option to allow automatically checking scripts for updates every 24 hours."
 	}, 
 	"labelSearchLink": {
 		"message": "搜索网址:", 
@@ -338,5 +338,21 @@
 	"menuCommands": {
 		"message": "脚本命令...", 
 		"description": "Menu item to list script commands."
+	}, 
+	"labelSearch": {
+		"message": "查找:", 
+		"description": "Label for search input in search box."
+	}, 
+	"labelReplace": {
+		"message": "替换:", 
+		"description": "Label for replace input in search box."
+	}, 
+	"buttonReplace": {
+		"message": "替换", 
+		"description": "Button to replace the current match."
+	}, 
+	"buttonReplaceAll": {
+		"message": "所有", 
+		"description": "Button to replace all matches."
 	}
-}
+}

+ 1 - 0
mylib/CodeMirror/search.css

@@ -4,4 +4,5 @@
 	right:0;
 	z-index:15;
 	background:lightgray;
+	padding:10px;
 }

+ 2 - 2
mylib/CodeMirror/search.js

@@ -42,8 +42,8 @@
 			dialog = wrap.appendChild(document.createElement("div"));
 			dialog.className='CodeMirror-dialog';
 		}
-		var text='<input class=CodeMirror-search placeholder="Search for"><button class=CodeMirror-findNext>&gt;</button><button class=CodeMirror-findPrev>&lt;</button><button class=CodeMirror-cancel>&times;</button>',closed=false,iS,iR;
-		if(rep) text+='<br><input class=CodeMirror-replace placeholder="Replace with"><button class=CodeMirror-replaceNext>Replace</button><button class=CodeMirror-replaceAll>All</button>';
+		var text=_('labelSearch')+'<input class=CodeMirror-search placeholder="Search for"><button class=CodeMirror-findNext>&gt;</button><button class=CodeMirror-findPrev>&lt;</button><button class=CodeMirror-cancel>&times;</button>',closed=false,iS,iR;
+		if(rep) text+='<br>'+_('labelReplace')+'<input class=CodeMirror-replace placeholder="Replace with"><button class=CodeMirror-replaceNext>'+_('buttonReplace')+'</button><button class=CodeMirror-replaceAll>'+_('buttonReplaceAll')+'</button>';
 		dialog.innerHTML=text;
 		iS=dialog.querySelector('.CodeMirror-search');
 		CodeMirror.on(dialog.querySelector('.CodeMirror-findNext'), "click", function(e) {findNext(cm);});