【发布时间】:2020-01-22 16:30:00
【问题描述】:
有一篇来自 Lukasz Dorosz 的文章 (https://medium.com/@mrdoro/fast-translation-with-google-translator-and-mac-osx-817e32233b7a) 关于使用 Apple Automator 将 Google 翻译器与 macOS 集成。我做到了,它有效。我的问题是 - 如何将 DeepL 翻译器与 macOS 集成?
使用 Automator,您可以通过几个步骤将 Goole Translator 与 macOS 集成:
打开 Automator 并创建一个新服务。 顶部这样设置: 从左栏中,您需要找到并获取两个函数:运行 >Apple 脚本和网站弹出窗口。 将此代码复制并粘贴到 Apple 脚本窗口中。
on run {input, parameters}
set output to "http://translate.google.com/translate_t?sl=auto&tl=ru&text=" & urldecode(input as string)
return output
end run
on urldecode(x)
set cmd to "'require \"cgi\"; puts CGI.escape(STDIN.read.chomp)'"
do shell script "echo " & quoted form of x & " | ruby -e " & cmd
end urldecode
如何更改脚本以使用来自 DeepL 而不是 Google 的翻译器?
【问题讨论】:
-
只是替换网址无效?
-
不,它不起作用 :((
-
您可以查看Using Deepl API to translate text 并使用deepl.com/translator#en/ru/hello 之类的内容进行测试。
-
@Dimitri 现在有一个适用于 Windows 和 Mac 的应用程序:deepl.com/en/app
标签: macos google-translate automator deepl