Jump to content
rice.shawn

Google Translate (Languages Configurable)

Recommended Posts

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. :(

 

Try adding a new API key to the Google project and then plugging that one in.

Share this post


Link to post

Try adding a new API key to the Google project and then plugging that one in.

 

 

Still not working.

 

By the way, why the first result has no flag or language? Look:

xPzgQ3m.png

P.S.: Notice, as I already pointed out in this thread, that the code for Brazilian Portuguese is wrong (pt-BZ instead pt-BR).

Edited by xilopaint

Share this post


Link to post

Still not working.

 

By the way, why the first result has no flag or language? Look:

xPzgQ3m.png

P.S.: Notice, as I already pointed in this thread, that the code for Brazilian Portuguese is wrong (pt-BZ instead pt-BR).

 

Try deleting the config file. It should be somewhere like ~/Library/Application Support/Alfred 2/Workflow Data/com.spr.translate.api/config.ini.

 

Then re-enter the api key and try again. More than likely there is a null value for the first item. I'll change the code for BR soon.

Share this post


Link to post

Try deleting the config file. It should be somewhere like ~/Library/Application Support/Alfred 2/Workflow Data/com.spr.translate.api/config.ini.

 

Then re-enter the api key and try again. More than likely there is a null value for the first item. I'll change the code for BR soon.

 

 

Nothing has changed and the null value persists. :(

Share this post


Link to post

Another thought for possible failure. Google provides three months free (basically), but if you downloaded the previous version and created the project on Google then, you didn't need to add a credit card to your account. If you haven't added one by now to let it bill you, then it might be rejecting the queries based on that.

Share this post


Link to post

Is it possible to add Pinyin to the results? The functionality doesn't seem to be published on Google's API documentation, however the Google API seems to support it (at least the previous version before they locked down the API) as seen in this package:

 

https://pypi.python.org/pypi/goslate#romanlization

 

I looked through the source for the  but couldn't even find where this package made an API call...

Share this post


Link to post

Is it possible to add Pinyin to the results? The functionality doesn't seem to be published on Google's API documentation, however the Google API seems to support it (at least the previous version before they locked down the API) as seen in this package:

 

https://pypi.python.org/pypi/goslate#romanlization

 

I looked through the source for the  but couldn't even find where this package made an API call...

 

It'll probably take me a while to get to this. If it were in the documentation, then it would be much easier to do, but otherwise I have to find the time to reverse engineer the API calls (which might change if they're not official).

Share this post


Link to post

Is it possible to add Pinyin to the results? The functionality doesn't seem to be published on Google's API documentation, however the Google API seems to support it (at least the previous version before they locked down the API) as seen in this package:

 

https://pypi.python.org/pypi/goslate#romanlization

 

I looked through the source for the  but couldn't even find where this package made an API call...

 

 

It adds &dt=rm to the URL.

Share this post


Link to post

;;;;;

; `config.ini` generated by Alphred v0.9.7

; at 2016-Feb-19 16:48:32

;;;;;

 

api_key = "xxxxxxxxxxxxxxx"

languages = ",pt-BR,en,es"

 

 

I think the null value is due to the first comma in ",pt-BR,en,es". Try to remove it, i.e. replace with "pt-BR,en,es".

Share this post


Link to post

I think the null value is due to the first comma in ",pt-BR,en,es". Try to remove it, i.e. replace with "pt-BR,en,es".

 

 

Yes, I had noticed that after the discussion. Thank you!

Share this post


Link to post

help me

 

Starting debug for 'Translate'

 

[2019-02-08 22:37:55][STDERR: input.scriptfilter] [22:37:54][filter.php:103][ERROR] Request completely failed, and no cached data exists. cURL debug information follows:

[22:37:54][filter.php:103][ERROR] cURL error number: 22

[22:37:54][filter.php:103][ERROR] cURL error message: `The requested URL returned error: 503 Service Unavailable`.

[22:37:55][filter.php:103][ERROR] Request completely failed, and no cached data exists. cURL debug information follows:

[22:37:55][filter.php:103][ERROR] cURL error number: 22

[22:37:55][filter.php:103][ERROR] cURL error message: `The requested URL returned error: 503 Service Unavailable`.

[2019-02-08 22:37:55][ERROR: input.scriptfilter] JSON error: JSON text did not start with array or object and option to allow fragments not set. in JSON:

Warning: Invalid argument supplied for foreach() in /Users/moritayu/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.000099A5-D31E-4F18-8757-38D71113EBF3/functions.php on line 22

 

Warning: Invalid argument supplied for foreach() in /Users/moritayu/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.000099A5-D31E-4F18-8757-38D71113EBF3/functions.php on line 22

<?xml version="1.0" encoding="UTF-8"?>

<items>

<item arg="{&quot;action&quot;:&quot;translate&quot;,&quot;translation&quot;:&quot;&quot;,&quot;original&quot;:&quot;word&quot;,&quot;code&quot;:&quot;ja&quot;,&quot;listen&quot;:&quot;&quot;}" valid="yes">

  <title></title>

  <subtitle>Japanese: word</subtitle>

  <icon>icons/ja.png</icon>

  <subtitle mod="cmd">Open in Web Browser</subtitle>

  <subtitle mod="alt">Listen to Translation</subtitle>

</item>

<item arg="{&quot;action&quot;:&quot;translate&quot;,&quot;translation&quot;:&quot;&quot;,&quot;original&quot;:&quot;word&quot;,&quot;code&quot;:&quot;en&quot;,&quot;listen&quot;:&quot;&quot;}" valid="yes">

  <title></title>

  <subtitle>English: word</subtitle>

  <icon>icons/en.png</icon>

  <subtitle mod="cmd">Open in Web Browser</subtitle>

  <subtitle mod="alt">Listen to Translation</subtitle>

</item>

</items>

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...