AlfredGoogleTranslateWorkflow icon indicating copy to clipboard operation
AlfredGoogleTranslateWorkflow copied to clipboard

translate on Alfred 3

Open thiemehennis opened this issue 7 years ago • 37 comments

does this workflow work on Alfred 3? As is, it does not seem to work (on my machine), but I have not yet ruled out other options. Because the Packal workflow explicitly states 'Alfred 2' workflow, this seemed to me the obvious reason.

thiemehennis avatar Aug 12 '16 09:08 thiemehennis

No it does not unfortunately. I don't have the Alfred 3 Powerpack so I can't port it.

thomashempel avatar Aug 12 '16 10:08 thomashempel

Got a license... So I can check it. Thank you!

thomashempel avatar Aug 12 '16 12:08 thomashempel

Okay, so I checked the workflow on Alfred 3 and it works for me so far. But that could be because I still have the Alfred 2 version around.

Can you please elaborate on what is not working in your setup?

thomashempel avatar Aug 14 '16 04:08 thomashempel

Please check out pre-release 3.2.0 and let me know if that works for you: https://github.com/thomashempel/AlfredGoogleTranslateWorkflow/releases/tag/3.2.0-pre1

thomashempel avatar Aug 14 '16 04:08 thomashempel

It does work! Thanks a lot! Have a nice week!

thiemehennis avatar Aug 15 '16 09:08 thiemehennis

Hello, there is no action triggered on my machine. Here is some logging:

#1 /Users/martin/Google Drive/exchange/osx/config/alfred/Alfred.alfredpreferences/workflows/user.workflow.6E397583-7A9F-4EBE-8219-E626BB8A9F3E/GoogleTranslateWorkflow.php(122): St in /Users/martin/Google Drive/exchange/osx/config/alfred/Alfred.alfredpreferences/workflows/user.workflow.6E397583-7A9F-4EBE-8219-E626BB8A9F3E/vendor/stichoza/google-translate-php/src/Stichoza/GoogleTranslate/TranslateClient.php on line 263
[2016-08-31 21:41:12][ERROR: input.scriptfilter] JSON error: JSON text did not start with array or object and option to allow fragments not set. in JSON:
Fatal error: Uncaught exception 'ErrorException' with message 'Server error: `POST http://translate.google.com/translate_a/t` resulted in a `503 Service Unavailable` response:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

Any idea how to fix it? I wish I could help you, but this workflow stuff is totally new to me.

pepperonas avatar Aug 31 '16 19:08 pepperonas

same here. Yesterday suddenly it stopped providing results. (and I just checked; still no results). It did work until recently though, so probably something on Google's end.

On Wed, Aug 31, 2016 at 9:44 PM, Martin Pfeffer [email protected] wrote:

Hello, at my machine it doesn't translate anything, no action is triggered. Here is some logging:

#1 /Users/martin/Google Drive/exchange/osx/config/alfred/Alfred.alfredpreferences/workflows/user.workflow.6E397583-7A9F-4EBE-8219-E626BB8A9F3E/GoogleTranslateWorkflow.php(122): St in /Users/martin/Google Drive/exchange/osx/config/alfred/Alfred.alfredpreferences/workflows/user.workflow.6E397583-7A9F-4EBE-8219-E626BB8A9F3E/vendor/stichoza/google-translate-php/src/Stichoza/GoogleTranslate/TranslateClient.php on line 263 [2016-08-31 21:41:12][ERROR: input.scriptfilter] JSON error: JSON text did not start with array or object and option to allow fragments not set. in JSON: Fatal error: Uncaught exception 'ErrorException' with message 'Server error: POST http://translate.google.com/translate_a/t http://translate.google.com/translate_a/t resulted in a 503 Service Unavailable response:

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thomashempel/AlfredGoogleTranslateWorkflow/issues/32#issuecomment-243878209, or mute the thread https://github.com/notifications/unsubscribe-auth/ACsPM096hY2q7-1quHHIsAR013vWpCE1ks5qldmjgaJpZM4Ji8B- .

thiemehennis avatar Sep 01 '16 07:09 thiemehennis

Yes, they must have changed something:

PHP Fatal error:  Uncaught exception 'ErrorException' with message 'Server error: `POST http://translate.google.com/translate_a/t` resulted in a `503 Service Unavailable` response:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><meta http-equiv="content-type" content="te (truncated...)
' in /Users/nlo/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484AF645-7BFD-4C98-978D-2580B0BD3F27/vendor/stichoza/google-translate-php/src/Stichoza/GoogleTranslate/TranslateClient.php:263
Stack trace:
#0 /Users/nlo/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484AF645-7BFD-4C98-978D-2580B0BD3F27/vendor/stichoza/google-translate-php/src/Stichoza/GoogleTranslate/TranslateClient.php(186): Stichoza\GoogleTranslate\TranslateClient->getResponse('asd')
#1 /Users/nlo/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484AF645-7BFD-4C98-978D-2580B0BD3F27/GoogleTranslateWorkflow.php(122): Stichoza\GoogleTransla in /Users/nlo/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.484AF645-7BFD-4C98-978D-2580B0BD3F27/vendor/

DONSA avatar Sep 01 '16 19:09 DONSA

Anyone has found a way to correct this ? Or is it due to some policy change by Google that is not authorizing some API ?

ghost avatar Sep 06 '16 20:09 ghost

Looks like Google closed the door on the API again. :-/

thomashempel avatar Sep 07 '16 05:09 thomashempel

Sad news. I just bought a license for Alfred 3 just because of this workflow ;). Any ideas how to workaround this issue ?

gevgeny avatar Oct 19 '16 09:10 gevgeny

I don't but Alfred is also useful without this workflow. But yes, this was my favourite as well!

hennis.nl // +31651855220 // Amsterdam, Delft

On Wed, Oct 19, 2016 at 11:25 AM, Eugene Gluhotorenko < [email protected]> wrote:

Sad news. I just buy a license for Alfred 3 just because of this workflow ;). Any ideas how to workaround this issue ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thomashempel/AlfredGoogleTranslateWorkflow/issues/32#issuecomment-254761098, or mute the thread https://github.com/notifications/unsubscribe-auth/ACsPM2o9BBnju99y0qrL-B_S9CDd_vQNks5q1eIbgaJpZM4Ji8B- .

thiemehennis avatar Oct 20 '16 10:10 thiemehennis

Sorry, guys. But since Google is trying to earn money with the translation API, they regularly change the access and break these kind of clients. I'm not sure how to solve this and to be honest I'm not sure if can dedicate enough time to support this anytime soon.

thomashempel avatar Oct 20 '16 10:10 thomashempel

Anyway thanks for the awesome try ;)

gevgeny avatar Oct 20 '16 10:10 gevgeny

It has apparently been fixed upstream at https://github.com/Stichoza/google-translate-php/issues/62. Obviously, I'm not that familiar, but if so this package only needs to update the dependency. Worst case scenario a bit of tweaking in the results might be required, but I don't think that'd be the case at all. Sadly I don't speak PHP so I'm hoping the author or someone more experienced than me would jump in. Thanks.

blackxored avatar Nov 16 '16 00:11 blackxored

I've created a pull request #34. Don't know if the author will aprove it, but you can still do the changes yourself. Run composer update stichoza/google-translate-php on the workflow folder and replace the file attached.

GoogleTranslateWorkflow.php.zip

DONSA avatar Nov 28 '16 21:11 DONSA

@DONSA Hello, bro. I can't set the sourceLanguages and the targetLanguages with your approach. I also use Alfred 3.

I just create a blank workflow. Then I clone this repo and replace your GoogleTranslateWorkflow.php file in its src dir. I run the composer update stichoza/google-translate-php command under src working dir. Lastly, I copy all files in src folder to my blank workflow finder's dir.

Did I missed any important thing? Thanks for reply. BTW Could you send me a worked workflow?

johnwatsondev avatar Jan 18 '17 13:01 johnwatsondev

Hi, No need to create a new workflow. Just cd into workflow source folder and run composer on it. Then replace the attached file.

DONSA avatar Jan 18 '17 13:01 DONSA

Thanks. Which release version did you use (3.2.0-pre1 or 3.1.2 in releases)?

johnwatsondev avatar Jan 18 '17 13:01 johnwatsondev

V3.1.2

DONSA avatar Jan 18 '17 13:01 DONSA

Thank you @DONSA

kopiro avatar Jan 18 '17 17:01 kopiro

Does this still work for you all? The operations work but the translation invariably returns ARRAY. Am I doing something wrong or did Google just change their API again?

olbrew avatar Jan 19 '17 02:01 olbrew

Works fine. I'm using stichoza/google-translate-php v3.2, make sure you use the same version. You can check it in composer.json.

DONSA avatar Jan 19 '17 07:01 DONSA

so it works fine with the latest version? Or only with modifications? If it works, that's new to me, I thought it did not work anymore due to changes at Google's side.

-- hennis.nl // +31651855220 // Amsterdam, Delft

On Thu, Jan 19, 2017 at 8:58 AM, Nuno [email protected] wrote:

Works fine. I'm using stichoza/google-translate-php v3.2, make sure you use the same version. You can check it in composer.json.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thomashempel/AlfredGoogleTranslateWorkflow/issues/32#issuecomment-273705733, or mute the thread https://github.com/notifications/unsubscribe-auth/ACsPM9djZqqzHpRA-nDI89wQub9BAL81ks5rTxeMgaJpZM4Ji8B- .

thiemehennis avatar Jan 19 '17 08:01 thiemehennis

Only with the modifications I did in GoogleTranslateWorkflow.php file.

DONSA avatar Jan 19 '17 08:01 DONSA

@DONSA thanks! I've found out what the problem was. The GoogleTranslateWorkflow.php you linked to in https://github.com/thomashempel/AlfredGoogleTranslateWorkflow/issues/32#issuecomment-263400058 points to the original one for some reason. Using the one from your Pull Request found here worked for me.

olbrew avatar Jan 20 '17 01:01 olbrew

for non-programmers - what is the step by step procedure to get this workflow working? Do I download the 'latest' workflow? And then?

thiemehennis avatar Jan 20 '17 08:01 thiemehennis

I will fork this project this weekend and create the workflow. I will post the link when it's finished.

DONSA avatar Jan 20 '17 08:01 DONSA

thanks Nuno!

-- hennis.nl // +31651855220 // Amsterdam, Delft

On Fri, Jan 20, 2017 at 9:58 AM, Nuno [email protected] wrote:

I will fork this project this weekend and create the workflow. I will post the link when it's finished.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thomashempel/AlfredGoogleTranslateWorkflow/issues/32#issuecomment-274014854, or mute the thread https://github.com/notifications/unsubscribe-auth/ACsPMwQloLspUzCsyxkC1TrHIVrW_X47ks5rUHdDgaJpZM4Ji8B- .

thiemehennis avatar Jan 20 '17 09:01 thiemehennis

Finally, I found the issue. My network is broken in fu*king China Mainland. :( I must use VPN get google translate working normally. @DONSA Thank for hard work again.

johnwatsondev avatar Jan 20 '17 10:01 johnwatsondev