-
-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with recent update from google api translate and complex strings #119
Comments
Ok, if anyone comes to a problem like this, for me, html_entity_decode() solve the problem!! |
could you provide some more details regarding your fix ? |
Sorry for the delay, is very simple indid, in the controller, the string about to be translated, it has to be sanitize first, remember, now is a get verb. I just create a simple function before translation.
then just $factor = $this->cleanText($muestra->body); |
But I still got that error. I added the function cleanText() before using it in translate() |
@gbelot2003 I've tried figuring out what was the original text you wanted to translate, and by decoding the url you pasted I found that it could have been the following:
I see that you also figured out that HTML entities caused the problem because you solved it using html_entity_decode(). But what's really interesting, if I copy&paste the text above to the official Google Translate page, I also get a translation error on that page (which I never ever saw before). See: It looks like this is an error with Google Translate itself, and I verified this as Google Translate fails even on a simple string if it contains any HTML entity like If anybody expects to translate strings containing HTML entities I suggest them to decode the strings with html_entity_decode() before passing them to the translate function, until Google fixes this issue. @Stichoza Until then I also suggest that this should be noted in the known limitations. |
Hello there. Just now I update the translate v3.4 module according with the changes you suggested, and for simple text works fine, but now the API uses the verb GET but the main problem is that I am using a text field with html, the answer is always: resulted in a
403 Forbidden
response:Im already using something like this to clear the code:
even after all this cleanning Im still getting this response from the server:
Client error:
GET https://translate.google.com/translate_a/single?client=webapp&hl=en&dt=t&sl=es&tl=en&q=DESCRIPCI%26Oacute%3BN+MACROSC%26Oacute%3BPICA%3A++%26nbsp%3B++Se+recibe+1+frasco+conteniendo+2+l%26aacute%3Bminas+con+frotis+fijados+con+alcohol+de+regi%26oacute%3Bn+sangrado+pez%26oacute%3Bn+derecho%2C+se+colorean+con+hematoxilina-eosina.++++DIAGN%26Oacute%3BSTICO%3A+PEZON+DERECHO%2C+ASPIRADO+AGUJA+FINA%2C+EXTENDIDOS+-+++%26nbsp%3B++COMENTARIO%3A&ie=UTF-8&oe=UTF-8&multires=1&otf=0&pc=1&trs=1&ssel=0&tsel=0&kc=1&tk=531074.928252
resulted in a403 Forbidden
response:My cuestion, is there a workaround, option or maybe another module to fix this issue,
thanks
The text was updated successfully, but these errors were encountered: