Jump to content

Google translate workflow


Recommended Posts

Hey guys,

 

here is a Google Translate workflow i made based on Anders Bech Mellson's work. Once again, I don't want to take credit for a work that isn't mine. I'm just feeding back to alfred the results of an already good extension.

 

Press enter to copy to clipboard, FN to look up on the actual translate.google.com website. 

 

It's really easy to add / remove / edit for your own set of languages, just look at the workflow.

 

http://cl.ly/MAI3

Link to comment
  • 2 weeks later...
  • 2 weeks later...
  • 1 month later...
  • 3 weeks later...
  • 4 weeks later...
  • 4 months later...

Great workflow!

I added some other languages that I would need. There seems to be some error in Eastern language as well. 

 

4u1AO.png4u1vC.png

 

While English to Japanese/Korean seems to work perfectly fine on the left, the it doesn't seem like that's the case as you can see on the right. Instead of returning the result "hello" it's simply romanticizing the query for some reason. I am guessing it's the text encoding isn't properly supporting Eastern language. Any idea how it may be fixed? or is this inherently impossible to fix without completely re-writting the script?

Link to comment
  • 2 weeks later...

No one has fixed this workflow yet?   B)

 

Well, if you ask like that… Revised version that:

  • handles non 7-bit ASCII characters (aka “what them foreignas use”) correctly, both as input and as output,
  • handles phrases correctly (i.e. as phrases, not as multiple separate terms),
  • adds a Paste into foreground application action (Cmd modifier),
  • uses a central script file so that adding languages is a matter of adding a simple command to a new script filter (./translate '<language code>' '<language name>' "{query}"),
  • is certified 100 % awk and sed free (you saw that coming, right?).

google-translate-feedback.png

(note the Russian and Chinese translations have only been added to showcase the international support – by default, the workflow still only translates to French, English, and Spanish). As usual, repo is here, direct download here.

Edited by kopischke
Link to comment

Unfortunate there seems to be a problem with the swedish characters "å", "ä" and "ö". Take a look at this screenshot http://cl.ly/image/3c0h2N2C0I20 

This word works great on the actually site so there seems to be a problem with your extension? 

Some word seems to work like "på". "över"

But words like "även", "ögon" doesn't work. 

 

@funtrix the revised version should work fine (I tested “ögon").

 

Great workflow!

I added some other languages that I would need. There seems to be some error in Eastern language as well. 

 

While English to Japanese/Korean seems to work perfectly fine on the left, the it doesn't seem like that's the case as you can see on the right. Instead of returning the result "hello" it's simply romanticizing the query for some reason. I am guessing it's the text encoding isn't properly supporting Eastern language. Any idea how it may be fixed? or is this inherently impossible to fix without completely re-writting the script?

 

@jink0421 let me know if the revised version handles this correctly (Chinese worked fine in my superficial tests).

Edited by kopischke
Link to comment

Great, thank you! :)

I added German and it works.

But every space is replaced by two backslashes:

Screenshot

 

Do you have any idea how to change this?

 

Make sure Alfred is not set to escape spaces in the script filter settings. The only checked escapes should be backquotes, backslashes and Dollar signs (as these are shell metacharacters that will be interpreted inside double quotes) as well as double quotes (as they end the quoting, obviously).

Edited by kopischke
Link to comment
  • 3 months later...
  • 1 month later...

I am new to the workflow.  I went through the introduction pages on alfred's web site but I am still confused.  What I want to achieve is to translate email I receive in German to English.  It'd be helpful if I can select a block of text in the email, hit a hotkey combination, the text is sent to Google translate in my default browser and displayed the translated text there.

 

From what I can tell, this workflow seems to do the job.  I just don't know how to make it work.

 

When I import the workflow into Alfred (2.x), it said "Hotkeys for new wrokflows will be stripped for your safety."

 

I found a place to add hotkeys but I don't know what action or arguments to choose.

 

Sorry about being an absolutely newbie but I desperate need some help. Many thanks in advance.

Link to comment
  • 3 weeks later...

You need to copy-paste or edit one of the existing Script Filters and edit it so that the Script text field contains this:
 

./translate 'el' 'Greek' "{query}"

Then you'll have to duplicate the connections to the various outputs (notification, copy to clipboard etc.)
 

bW0CaEc.png

ym6hTju.png

Edited by deanishe
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...