thomashempel / AlfredGoogleTranslateWorkflow

A workflow for Alfred that implements translation from any language to any other language that is supported by google
MIT License
401 stars 41 forks source link

No more result (broken api?) #7

Closed ignazioc closed 10 years ago

ignazioc commented 10 years ago

Hi, there is a problem with your workflow. I'm using Alfred V2 and none translation give me a result. I've checked the log and i think that is a problem with the url that you are using. This is the error:

Starting debug for 'Google Translate'

[ERROR: alfred.workflow.input.scriptfilter] Code 0: PHP Notice:  Trying to get property of non-object in /Users/[myusername]/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.C247A197-F67F-46B1-A69F-CFE735A6CF47/googleTranslate.php on line 82
[ERROR: alfred.workflow.input.scriptfilter] Code 0: PHP Notice:  Trying to get property of non-object in /Users/[myusername/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.C247A197-F67F-46B1-A69F-CFE735A6CF47/googleTranslate.php on line 82

and if I have correctly understood, this is the URL built for translate the word car

http://translate.google.com.br/translate_a/t?client=p&text=&hl=en-EN&sl=auto&tl=car&multires=1&ssel=0&tsel=0&sc=1&ie=UTF-8&oe=UTF-8

and this is the returned json

{"sentences":[{"trans":"","orig":"","translit":"","src_translit":""}],"src":"en","server_time":1}
thomashempel commented 10 years ago

Hm, I don't have any problems here.

Anyway, it's strange why it uses ".com.br" Must have overlooked that. I will check

The URL is wrong too. It should be

http://translate.google.com.br/translate_a/t?client=p&text=car&hl=en-EN&sl=en-EN&tl=de-DE&multires=1&ssel=0&tsel=0&sc=1&ie=UTF-8&oe=UTF-8

ignazioc commented 10 years ago

even with .com the issue is the same. I'm from italy.

thomashempel commented 10 years ago

Can you please check the following URL:

http://translate.google.com.br/translate_a/t?client=p&text=car&hl=en-EN&sl=en-EN&tl=de-DE&multires=1&ssel=0&tsel=0&sc=1&ie=UTF-8&oe=UTF-8

ignazioc commented 10 years ago

it seems ok https://gist.github.com/11205257

2014-04-23 9:07 GMT+02:00 Thomas Hempel notifications@github.com:

Can you please check the following URL:

http://translate.google.com.br/translate_a/t?client=p&text=car&hl=en-EN&sl=en-EN&tl=de-DE&multires=1&ssel=0&tsel=0&sc=1&ie=UTF-8&oe=UTF-8

— Reply to this email directly or view it on GitHubhttps://github.com/thomashempel/AlfredGoogleTranslateWorkflow/issues/7#issuecomment-41130892 .

thomashempel commented 10 years ago

That is strange. I would assume, that there is something wrong with your Alfred installation. The problem suggests, that PHP can't evaluate the result into something useful. But the Google API returns something parseable in any case. :-/

I just uploaded a new version 2.1.1. Can you please check that one?

ignazioc commented 10 years ago

hum..very strange. I've installed the new version from here https://github.com/thomashempel/AlfredGoogleTranslateWorkflow/raw/master/GoogleTranslate.alfredworkflow

and the problem is the same.

there is a simple way to print out (even in the debug window) the json returned from google?

I'm now at my office and we have some firewall policy.

2014-04-23 9:16 GMT+02:00 Thomas Hempel notifications@github.com:

That is strange. I would assume, that there is something wrong with your Alfred installation. The problem suggests, that PHP can't evaluate the result into something useful. But the Google API returns something parseable in any case. :-/

I just uploaded a new version 2.1.1. Can you please check that one?

— Reply to this email directly or view it on GitHubhttps://github.com/thomashempel/AlfredGoogleTranslateWorkflow/issues/7#issuecomment-41131447 .

thomashempel commented 10 years ago

Can you please tell me what you are typing into the Alfred command prompt?

ignazioc commented 10 years ago

translate car

https://www.dropbox.com/s/axy0bdp318vzfxr/Screenshot%202014-04-23%2009.49.34.png thanks for your help

2014-04-23 9:35 GMT+02:00 Thomas Hempel notifications@github.com:

Can you please tell me what you are typing into the Alfred command prompt?

— Reply to this email directly or view it on GitHubhttps://github.com/thomashempel/AlfredGoogleTranslateWorkflow/issues/7#issuecomment-41132637 .

thomashempel commented 10 years ago

Now that makes sense. You have to tell it what language you want to translate to. e.g.

translate it car

That will try to determine the source language automatically and translate the input to italian.

You can also define the source and the target language. In your example:

translate en>it car

That assumes that your input is english and that you want to translate it to italian.

translate de>it Haus

Will translate the german word "Haus" to italian "Casa".

ignazioc commented 10 years ago

of course I've tried also with the language ;) https://www.dropbox.com/s/hdhl6zrg28eaiaq/Screenshot%202014-04-23%2010.15.18.png

thanks for your help

2014-04-23 9:56 GMT+02:00 Thomas Hempel notifications@github.com:

No that makes sense. You have to tell it what language you want to translate to. e.g.

translate it car

That will try to determine the source language automatically.

You can also define the source and the target language. In your example:

translate en>it car

That assumes that your input is english and that you want to translate it to italian.

translate de>it Haus

Will translate the german word "Haus" to italian "Casa".

— Reply to this email directly or view it on GitHubhttps://github.com/thomashempel/AlfredGoogleTranslateWorkflow/issues/7#issuecomment-41134047 .

ignazioc commented 10 years ago

Hi! just to update you, I've installed the same file at home, on a different mac and everything works fine.

Is it very strange.

2014-04-23 10:15 GMT+02:00 Ignazio Calò ignazioc@gmail.com:

of course I've tried also with the language ;)

https://www.dropbox.com/s/hdhl6zrg28eaiaq/Screenshot%202014-04-23%2010.15.18.png

thanks for your help

2014-04-23 9:56 GMT+02:00 Thomas Hempel notifications@github.com:

No that makes sense. You have to tell it what language you want to

translate to. e.g.

translate it car

That will try to determine the source language automatically.

You can also define the source and the target language. In your example:

translate en>it car

That assumes that your input is english and that you want to translate it to italian.

translate de>it Haus

Will translate the german word "Haus" to italian "Casa".

— Reply to this email directly or view it on GitHubhttps://github.com/thomashempel/AlfredGoogleTranslateWorkflow/issues/7#issuecomment-41134047 .

thomashempel commented 10 years ago

Thanks for the info. I guess you have a strange combination of network limitations and OS/Alfred setup going on.

Greets, Thomas