把Safari整个页面翻译成中文,,
Step1
首先我们要随意打开一个Safari网页,通过Command + D 快捷键添加书签,选择添加到【个人收藏】,起名为“翻译”或其他的什么都可以。
<ignore_js_op>
Step2
这样这个网页就会出现在上方的个人收藏栏,找到“翻译”这个收藏按钮并右键,选择编辑地址。填入如下代码,可以选择一个你喜欢的添加:
<ignore_js_op>
<ignore_js_op>
有道翻译至中文:
- javascript: void((function() {var element = document.createElement(\’script\’);element.id = \’outfox_seed_js\’;element.charset = \’utf-8\’,element.setAttribute(\’src\’, \’http://fanyi.youdao.com/web2/seed.js?\’ + Date.parse(new Date()));document.body.appendChild(element);})())
复制代码
谷歌翻译至中文:
- javascript:var t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection&&document.selection.createRange&&document.selection.createRange().text));var e=(document.charset||document.characterSet);if(t!=\’\’){location.href=\’http://translate.google.com/?text=\’+t+\’&hl=zh-CN&langpair=auto|zh-CN&tbb=1&ie=\’+e;}else{location.href=\’http://translate.google.com/translate?u=\’+encodeURIComponent(location.href)+\’&hl=zh-CN&langpair=auto|zh-CN&tbb=1&ie=\’+e;};
复制代码
Step 3
这样就大功告成了,随便打开一个外文网页,点击个人收藏栏中的“翻译”按钮,就可以直接将这个网页翻译成为中文了!