alfredappuser Posted October 29, 2015 Share Posted October 29, 2015 (edited) Okay, so if you look here: http://www.packal.org/workflow/translate-api, you'll find a new copy of this workflow that uses the paid translation API. It seems to work just fine with my tests. You'll have to get an API key from Google. The workflow has a different bundleid, so it won't replace the old one, and the keyword for this one is just "tr". I changed the behavior so that it outputs only one language at a time so that you don't pay for what you don't need. Also, the workflow is setup so that translations are cached for about a month, so if you keep translating the same word over and over, it won't actually hit the Google API after the first time. Lastly, the "speak" action was taken out because that was also part of the unofficial API that is no longer working. I'll see if I can get that back in there sometime. Hey Shawn! Thank you for your new workflow. If anybody else have problems with setting up an API key (basically I've followed https://cloud.google.com/translate/v2/getting_started?hl=en#setup): create or select a project in the Google Developers Console and enable the API -> I've created a new Project project settings page -> Add my billing informations Add a Browser-API-Key without adding a HTTP-Referrer Added the Browser-API-Key in the workflow I had to wait a few minutes, after my api-key was accepted when trying to translate something. (The best thing is to debug the workflow within alfred app -> after a few minutes waiting the 403 forbidden error was gone.) @Shawn: Is it possible to enable more language at the same time - as it was in the "previous" workflow which don't used the translate API? I often translate DE>EN and EN>DE. Or maybe a 2nd keyword which translates the 2nd configuration. Thanks for the new workflow!!!! Edited October 29, 2015 by alfredappuser Link to comment
xilopaint Posted October 29, 2015 Share Posted October 29, 2015 @Shawn: Is it possible to enable more language at the same time - as it was in the "previous" workflow which don't used the translate API? Thanks for the new workflow!!!! +1 Link to comment
rice.shawn Posted October 29, 2015 Author Share Posted October 29, 2015 Hi, i have a problem, transalate docent works. When i write nothing happend See the above posts for a better explanation. The regular translate workflow is no longer working because Google shutdown the API. You can grab the "Translate API" workflow (again see above) for a version that works with the paid API. Link to comment
rice.shawn Posted October 29, 2015 Author Share Posted October 29, 2015 @Shawn: Is it possible to enable more language at the same time - as it was in the "previous" workflow which don't used the translate API? I often translate DE>EN and EN>DE. Or maybe a 2nd keyword which translates the 2nd configuration. Thanks for the new workflow!!!! I could re-implement that logic. I took it out because the new one is paid, and I didn't want users to blow extra characters on the problem, but, again, I can re-implement it. Give me a couple of days. Work is crazy right now. wallace and alfredappuser 2 Link to comment
paulw Posted November 3, 2015 Share Posted November 3, 2015 I can't find where to add my API in the workflow. Any help? Link to comment
rice.shawn Posted November 7, 2015 Author Share Posted November 7, 2015 I can't find where to add my API in the workflow. Any help? When you first start typing, it should tell you that there is no API key installed. Just press enter, and it will bring up an AppleScript dialog box that you can paste your API key into. After that, it's stored in the OS X Keychain, so you can either manipulate it there, or just delete it from there. Link to comment
paulw Posted November 7, 2015 Share Posted November 7, 2015 When you first start typing, it should tell you that there is no API key installed. Just press enter, and it will bring up an AppleScript dialog box that you can paste your API key into. After that, it's stored in the OS X Keychain, so you can either manipulate it there, or just delete it from there. Oh, ok. I think I must have still been using the non-API script. Works great, thank you! Link to comment
xilopaint Posted November 7, 2015 Share Posted November 7, 2015 I could re-implement that logic. I took it out because the new one is paid, and I didn't want users to blow extra characters on the problem, but, again, I can re-implement it. Give me a couple of days. Work is crazy right now. News about this? wallace 1 Link to comment
rice.shawn Posted November 7, 2015 Author Share Posted November 7, 2015 News about this? I've been way swamped. Too much so to get back to this right now. The code isn't too hard to write, but the UX part is more difficult to work out. xilopaint 1 Link to comment
OmarKN Posted November 8, 2015 Share Posted November 8, 2015 Hi and good day, My php seems to be ok, ( PHP 5.5.27 ) - on Yosemite - I get: "Type to translate…" then: Alfred wants to go on to the web, "Search Google:" Hopefully this can be resolved, maybe it's Google's fault? / with best regards, Omar KN Stockholm, Sweden Link to comment
rice.shawn Posted November 8, 2015 Author Share Posted November 8, 2015 Hi and good day, My php seems to be ok, ( PHP 5.5.27 ) - on Yosemite - I get: "Type to translate…" then: Alfred wants to go on to the web, "Search Google:" Hopefully this can be resolved, maybe it's Google's fault? / with best regards, Omar KN Stockholm, Sweden Are you using the Translate workflow or the Translate API workflow? The first one (keyword: trans) no longer works because Google shutdown that API. The second one (keyword: tr) should be working quite well, but you need to get an API key from Google before it can work. Link to comment
OmarKN Posted November 11, 2015 Share Posted November 11, 2015 (edited) Hi Shawn, Got the API, although didn't see anywhere I would have to pay. + don't know where to enter it / in the script? (it has only: php action.php "{query}") When in Alfred I type "tr" it actually worked the first try!!! but later not, then it always falls back to "trans" and sends me to the Google translate webpage. Could you please shed some light on this topic :-) / with best regards, Omar KN Stockholm, Sweden (PS: the .configure action does work) (PS: On the packal.org/workflow/translate - page there is vs. 1.3.1 for download, although there seems to be an update version 1.3.2 ) Edited November 11, 2015 by OmarKN Link to comment
paulw Posted November 12, 2015 Share Posted November 12, 2015 You might want to disable the original translate script. Then try. The API version should automatically ask your for your API. You also cannot get an API without paying for it via Google Billing account. Link to comment
OmarKN Posted November 24, 2015 Share Posted November 24, 2015 Hi and good day, Got the API key & almost everything working fine now, except for when I use the hotkey to launch the Translate API workflow it always proposes the word ”trans”, although it is ”tr ” set as keyword. Also a system sound can be hears at that moment. - I restarted the Mac, - removed all other earlier versions of translate workflows from Alfred - checked other apps if they use the same hotkeys So to make it work I always have to delete the letters "ans" to get the letters "tr ", what could be the reason here? Some old plist maybe? (debug doesn't do anything for workflows) / with best regards, Omar KN Stockholm, Sweden Link to comment
wallace Posted December 17, 2015 Share Posted December 17, 2015 I could re-implement that logic. I took it out because the new one is paid, and I didn't want users to blow extra characters on the problem, but, again, I can re-implement it. Give me a couple of days. Work is crazy right now. please my friend, it took me 2 hours to get it working.. i thought it was like the old workflow where you could do that. Link to comment
xilopaint Posted December 26, 2015 Share Posted December 26, 2015 The workflow with the official API is no longer working for me: [sTDERR: alfred.workflow.input.scriptfilter] [09:56:21][filter.php:86][ERROR] Request completely failed, and no cached data exists. cURL debug information follows: [09:56:21][filter.php:86][ERROR] cURL error number: 22 [09:56:21][filter.php:86][ERROR] cURL error message: `The requested URL returned error: 403 Forbidden`. Link to comment
alfredappuser Posted December 29, 2015 Share Posted December 29, 2015 The workflow with the official API is no longer working for me: [sTDERR: alfred.workflow.input.scriptfilter] [09:56:21][filter.php:86][ERROR] Request completely failed, and no cached data exists. cURL debug information follows: [09:56:21][filter.php:86][ERROR] cURL error number: 22 [09:56:21][filter.php:86][ERROR] cURL error message: `The requested URL returned error: 403 Forbidden`. I don't have problems. Do you set up your project at google? Link to comment
greenfish29 Posted January 10, 2016 Share Posted January 10, 2016 Are you using the Translate workflow or the Translate API workflow? The first one (keyword: trans) no longer works because Google shutdown that API. The second one (keyword: tr) should be working quite well, but you need to get an API key from Google before it can work. This means that Translate workflow is dead? I'm confused because it works sometimes (circa 50%). If this workflow Should be the workflow removed from packal and similar pages? Link to comment
rice.shawn Posted February 18, 2016 Author Share Posted February 18, 2016 Translate API has been updated to v 1.10, which includes multiple language support. If you update to this version, then you'll have to reset the languages again (even if you want to use only one). Packal: http://www.packal.org/workflow/translate-api Link to comment
rice.shawn Posted February 18, 2016 Author Share Posted February 18, 2016 This means that Translate workflow is dead? I'm confused because it works sometimes (circa 50%). If this workflow Should be the workflow removed from packal and similar pages? I'm going to leave it up there in case anyone has any interest in the code. A newer version of Packal (yet to be released; sorry, so busy), has a deprecated flag that can be set as well as a deprecated_for flag that will notify the users as to which one to download. Link to comment
xilopaint Posted February 18, 2016 Share Posted February 18, 2016 Translate API has been updated to v 1.10, which includes multiple language support. If you update to this version, then you'll have to reset the languages again (even if you want to use only one). Packal: http://www.packal.org/workflow/translate-api Not working for me. Link to comment
rice.shawn Posted February 18, 2016 Author Share Posted February 18, 2016 (edited) Not working for me. Can you open up the debugger and tell me what the console says? There should be some helpful errors there. It is working for me: Edited February 18, 2016 by Shawn Rice Link to comment
xilopaint Posted February 19, 2016 Share Posted February 19, 2016 Starting debug for 'Translate API' [sTDERR: alfred.workflow.input.scriptfilter] [15:21:51][filter.php:122][ERROR] Request completely failed, and no cached data exists. cURL debug information follows: [15:21:51][filter.php:122][ERROR] cURL error number: 22 [15:21:51][filter.php:122][ERROR] cURL error message: `The requested URL returned error: 403 Forbidden`. [15:21:52][filter.php:122][ERROR] Request completely failed, and no cached data exists. cURL debug information follows: [15:21:52][filter.php:122][ERROR] cURL error number: 22 [15:21:52][filter.php:122][ERROR] cURL error message: `The requested URL returned error: 403 Forbidden`. [15:21:52][filter.php:122][ERROR] Request completely failed, and no cached data exists. cURL debug information follows: [15:21:52][filter.php:122][ERROR] cURL error number: 22 [15:21:52][filter.php:122][ERROR] cURL error message: `The requested URL returned error: 403 Forbidden`. [15:21:53][filter.php:122][ERROR] Request completely failed, and no cached data exists. cURL debug information follows: [15:21:53][filter.php:122][ERROR] cURL error number: 22 [15:21:53][filter.php:122][ERROR] cURL error message: `The requested URL returned error: 403 Forbidden`. Link to comment
rice.shawn Posted February 19, 2016 Author Share Posted February 19, 2016 Starting debug for 'Translate API' [sTDERR: alfred.workflow.input.scriptfilter] [15:21:51][filter.php:122][ERROR] Request completely failed, and no cached data exists. cURL debug information follows: [15:21:51][filter.php:122][ERROR] cURL error number: 22 [15:21:51][filter.php:122][ERROR] cURL error message: `The requested URL returned error: 403 Forbidden`. [15:21:52][filter.php:122][ERROR] Request completely failed, and no cached data exists. cURL debug information follows: [15:21:52][filter.php:122][ERROR] cURL error number: 22 [15:21:52][filter.php:122][ERROR] cURL error message: `The requested URL returned error: 403 Forbidden`. [15:21:52][filter.php:122][ERROR] Request completely failed, and no cached data exists. cURL debug information follows: [15:21:52][filter.php:122][ERROR] cURL error number: 22 [15:21:52][filter.php:122][ERROR] cURL error message: `The requested URL returned error: 403 Forbidden`. [15:21:53][filter.php:122][ERROR] Request completely failed, and no cached data exists. cURL debug information follows: [15:21:53][filter.php:122][ERROR] cURL error number: 22 [15:21:53][filter.php:122][ERROR] cURL error message: `The requested URL returned error: 403 Forbidden`. The 403 error is happening because Google is denying you access to the translation. Read through the (short) introduction and then follow the setup instructions here: https://cloud.google.com/translate/v2/getting_started. After that, set the API key correctly in the workflow. Link to comment
xilopaint Posted February 19, 2016 Share Posted February 19, 2016 The 403 error is happening because Google is denying you access to the translation. Read through the (short) introduction and then follow the setup instructions here: https://cloud.google.com/translate/v2/getting_started. After that, set the API key correctly in the workflow. I can't understand what's going on. I used this workflow some time ago with the paid API and decided to stop until the multiple langue support was released. Now the workflow no longer works. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now