Skip to content

Instantly share code, notes, and snippets.

@buddax2
Created March 25, 2018 22:37
Show Gist options
  • Star 19 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save buddax2/a51b4452b47dc5d30d0f9ea511b5e52e to your computer and use it in GitHub Desktop.
Save buddax2/a51b4452b47dc5d30d0f9ea511b5e52e to your computer and use it in GitHub Desktop.
Google Translate Automator Service
on run {input, parameters}
set output to "http://translate.google.com/translate_t?sl=auto&tl=uk&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
@Kingson
Copy link

Kingson commented Mar 30, 2018

Great!
Thank you!

@Pumpith
Copy link

Pumpith commented Apr 18, 2018

Thank you!\

@GoodNew5
Copy link

Thank you

@Kishito-PM
Copy link

Thanks a lot friend

@admradius
Copy link

Found this Post
and updated the url to:
https://translate.google.com/#auto/en/" & urldecode(input as string)
Dropping the GET url for the ReST Path url style and going http: -> https:

Works great!

@ChrisTrivedi
Copy link

Found this Post
and updated the url to:
https://translate.google.com/#auto/en/" & urldecode(input as string)
Dropping the GET url for the ReST Path url style and going http: -> https:

Works great!

I get an error when updating the url. I am no expert, what might I be doing wrong? Thank you in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment