Florian

Google translate workflow

52 posts in this topic

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

drking, Enhorn, Domenic and 5 others like this

Share this post


Link to post

This is an awesome workflow, thanks !

However, I noticed a small bug : when you type a " . ", the workflow doesn't consider possible words after

Share this post


Link to post

Is there perhaps a way of inserting the gender of the noun you are translating? For example: dog --> der Hund --> el perro 

 

That would be amazing :)

Domenic likes this

Share this post


Link to post

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?

 

OT:How can I post screenshots so that they are displayed inside the forum?

Share this post


Link to post

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. 

Share this post


Link to post

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?

Share this post


Link to post

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
Florian, arsenty and morocons like this

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

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.

Share this post


Link to post

Hmm. I've detected a flaw in the Google Translate algorithm.

 

The English translation is correct, but it seems Google translated to English first then to French and Spanish, misunderstanding its own translation along the way  :D

 

Qki7ukz.png

Share this post


Link to post

If I wanted to translate from English to Greek and vice versa, how would I go about editing the workflow?  Apparently, I am unable to edit it correctly.

Share this post


Link to post

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

Share this post


Link to post

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