Joomfish and Google translate

This forum is dedicated to the Joom!Fish 2.2.x core release. This release is dedicated to Joomla 1.5 code base and therefore we will not answer any questions related Joomla 2.5+ here.

Joomfish and Google translate

Postby Savemygame on Tue Jul 10, 2012 11:55 am

Hello

I"ve inserted my Google translate v2 API key in the configuration/parameters section.
But nothing happens.
Do I need to visit the page in the language i want to be translated to get the API trying to do its job ?

I can't find any information about using the google translate into joomfish.

Thanks for any help you can provide.
Savemygame
Newbee
 
Posts: 15
Joined: Thu Sep 16, 2010 10:07 am

Re: Joomfish and Google translate

Postby quodo on Tue Jul 10, 2012 2:33 pm

Note: I dont' have a Google translate v2 API key to test with...

Go to the Translate screen (Backend > Components > JoomFish > Translation), select a language you want to translate to (Languages select box) and select the Content Element Contents. Then click any article you want to translate and a new screen opens. In that new screen there is a part with the label "Article Text". Next to it there are three buttons, one of which is "Translate". If I click that, without an API key, I get a message "For automatic Google translations you need to get an API key from Google (commercial). See here https://code.google.com/intl/en-GB/apis ... icing.html", I'd expect you to get a translation in the editor field since you entered a Google API key in the JoomFish parameters, however, I've never done it myself.
quodo
Contributor
 
Posts: 556
Joined: Wed Feb 03, 2010 3:08 pm

Re: Joomfish and Google translate

Postby Savemygame on Tue Jul 10, 2012 5:36 pm

Thank you quodo, that is a good start and found the translate button.
Now when i click on it, nothing happens. No translated text or message. Did you get a pop up message ?

On google API console here is the configuration :
Key for browser apps (with referers)
API key:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx
Referers:
*.mydomain.com/*.
Activated on: Jul 2, 2012 8:55 AM
Savemygame
Newbee
 
Posts: 15
Joined: Thu Sep 16, 2010 10:07 am

Re: Joomfish and Google translate

Postby quodo on Tue Jul 10, 2012 6:12 pm

Savemygame wrote:Did you get a pop up message ?

I don't have an API key so I get a javascript alert. If I use a dummy key (e.g. just fill in some text) I get a javascript popup saying "Bad Request".

In the page source there is a part
Code: Select all
var source = 'https://www.googleapis.com/language/translate/v2?key=test&source=en&target=nl&callback=translateText&q=' + sourceText;
out of curiosity, what happens when you go to the link
Code: Select all
https://www.googleapis.com/language/translate/v2?key=test&source=en&target=nl&callback=translateText&q=world
while replacing 'test' with your key? Could that be a way to test the key? Don't know, but it's what I'd try...
quodo
Contributor
 
Posts: 556
Joined: Wed Feb 03, 2010 3:08 pm

Re: Joomfish and Google translate

Postby Savemygame on Tue Jul 10, 2012 6:15 pm

here is the result

// API callback
translateText({
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured"
}
],
"code": 403,
"message": "Access Not Configured"
}
}
);

That is made from my browser on my home PC. I must do it from my hosting server because there are some referers to limit abuse.

Update: there is a report stats on google API and I get my stat update (1 request) just after your test link (report error 400), so I maybe suggest that there is no request from my hosting server to google api.
Savemygame
Newbee
 
Posts: 15
Joined: Thu Sep 16, 2010 10:07 am

Re: Joomfish and Google translate

Postby quodo on Tue Jul 10, 2012 8:53 pm

Googled the "Access Not Configured" message and there are a lot of posts everywhere about that: http://code.google.com/p/google-api-dot ... ingStarted (at the bottom of the page)

Perhaps your home pc is not allowed to use the API key? I'm reading things about IP and webaddresses (e.g. joomfish.net) being whitelisted, so are these things set up okay?
quodo
Contributor
 
Posts: 556
Joined: Wed Feb 03, 2010 3:08 pm

Re: Joomfish and Google translate

Postby Savemygame on Wed Jul 11, 2012 10:11 am

Theses things are setup OK for my hosting server.

By reading previous post of the topic you said :"I don't have an API key so I get a javascript alert. If I use a dummy key (e.g. just fill in some text) I get a javascript popup saying "Bad Request".

I've got a javascript alert If i don't have an API key
I've got nothing (no Bad request) when I put a dummy key. I'm not sure that joomfish is requesting to google api because no popup answer is given.
Or maybe my web server is not well configured to handle specific call function from joomfish to remote site.
Savemygame
Newbee
 
Posts: 15
Joined: Thu Sep 16, 2010 10:07 am

Re: Joomfish and Google translate

Postby quodo on Wed Jul 11, 2012 12:25 pm

Savemygame wrote:I've got a javascript alert If i don't have an API key
I've got nothing (no Bad request) when I put a dummy key. I'm not sure that joomfish is requesting to google api because no popup answer is given.
Or maybe my web server is not well configured to handle specific call function from joomfish to remote site.
I'm using Mozilla Firefox, perhaps you can try a few browsers? Internet Explorere, Mozilla Firefox, Safari come to mind...
quodo
Contributor
 
Posts: 556
Joined: Wed Feb 03, 2010 3:08 pm

Re: Joomfish and Google translate

Postby Savemygame on Tue Jul 24, 2012 9:06 pm

Hello

i've made this request from my server
wget https://www.googleapis.com/language/translate/v2?key="MyAPIkey"&source=en&target=nl&callback=translateText&q=world
[1] 5850
[2] 5851
[3] 5852
[4] 5853
[4]+ Done callback=translateText
root@vks19757:~# --2012-07-24 21:00:57-- https://www.googleapis.com/language/translate/v2?key="MyAPIkey"
Resolving www.googleapis.com... 2a00:1450:4001:c01::5f, 173.194.70.95
Connecting to www.googleapis.com|2a00:1450:4001:c01::5f|:443... connected.
HTTP request sent, awaiting response... 400 Bad Request
2012-07-24 21:00:57 ERROR 400: Bad Request.


I've also made a test from backend of joomfish admin with firefox, no result
Savemygame
Newbee
 
Posts: 15
Joined: Thu Sep 16, 2010 10:07 am

Re: Joomfish and Google translate

Postby Savemygame on Mon Aug 06, 2012 9:50 am

Any help about the URL request that seems to be malformed ?
Savemygame
Newbee
 
Posts: 15
Joined: Thu Sep 16, 2010 10:07 am

Next

Return to Joom!Fish 2.2.x Core Extension

Who is online

Users browsing this forum: No registered users and 1 guest