|
You can try use
string.Format(",\"{0}\"", Translator.LanguageEnumToIdentifier(sourceLanguage))
instead of
string.Format(",,\"{0}\"", Translator.LanguageEnumToIdentifier(sourceLanguage))
result will be more reasonable:
moineau ,,,, noun passereaux moineau ,,0.45783335, passereaux ,,0.0033880526, pierrot ,,0.0024787523, sparrow
Nothing wrong from Google side - you just need to improve you parser
|
|
|
|
|
Not quite, because I think that affects other cases. Anyway, I have a fix and will be releasing it shortly.
Thanks,
/ravi
|
|
|
|
|
You can fork - two comma pattern for several words case and one comma pattern for single word.
Now nothing can be broken.
|
|
|
|
|
Yep, that's exactly what I did. The article has been updated - please test.
Thanks!
/ravi
|
|
|
|
|
Fix coming shortly... doing some final testing before I update the article.
/ravi
|
|
|
|
|
Fixed in the latest version (6-May-2015).
/ravi
|
|
|
|
|
Sorry, Ravi - again error - you need to change you logic:
else
{
text = text.Substring(0, index);
text = text.Replace("],[", ",");
text = text.Replace("]", string.Empty);
text = text.Replace("[", string.Empty);
text = text.Replace("\",\"", "\"");
string[] phrases = text.Split(new[] { '\"' }, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; (i < phrases.Count()); i += 2)
{
translation += phrases[i] + " ";
}
translation = translation.Trim();
translation = translation.Replace(" ?", "?");
translation = translation.Replace(" !", "!");
translation = translation.Replace(" ,", ",");
translation = translation.Replace(" .", ".");
translation = translation.Replace(" ;", ";");
}
Mark Doubson, Montreal, Canada
|
|
|
|
|
It seems to work fine for me, Mark. Are you having problems translating a specific phrase?
/ravi
|
|
|
|
|
Yes because I don't get your updated source and only get updated published text where you also split cases. Here you properly get Translated word for one word case but after you start from old returned Text again with double comma pattern - and it generate pages of something irrelevant.
|
|
|
|
|
Ugh. I suspect the sample in the article is out of sync with the actual code. Will fix.
/ravi
|
|
|
|
|
The article has been updated. GoogleTranslator is working again.
Enjoy!
/ravi
|
|
|
|
|
Thank you sir!
Amazing!
Toll!
Tuyệt vời!
|
|
|
|
|
Could you please tell me where to find a binary version of this app!? Thank you!
|
|
|
|
|
The binary isn't supplied, but you can build the app from the source.
/ravi
|
|
|
|
|
Just a quick note to let readers know that a new version of GoogleTranslator will be available shortly.
Cheers,
/ravi
|
|
|
|
|
Hello Sir,
I downloaded sample code and run. But it is not working properly.
Please help me ASAP.
Thanks,
Puspita.
|
|
|
|
|
I'll look into it when I get the chance.
Thanks,
/ravi
|
|
|
|
|
|
|
It does not work anymore. Perhaps because of some recent change by Google ...
|
|
|
|
|
http://stackoverflow.com/questions/29532717/redirected-to-captcha-when-accessing-google-translate
I'm trying to retrieving data from Google Translate for my website. I use this sample for retrieving data from Google Translate:
http://translate.google.com/translate_a/t?client=t&text=find&hl=en&sl=en&tl=fr
but now it's redirecting me to:
http://ipv4.google.com/sorry
This has been working fine for me for the last two years, but the issue appeared last night. What is causing this, and what can I do about it?
php google-translate
shareimprove this question
edited Apr 10 at 21:00
dimo414
9,68323979
asked Apr 9 at 7:46
Khoj
214
From the docs: "Google Translate API is available as a paid service." Are you paying for these translations? – dimo414 Apr 10 at 21:04
|
|
|
|
|
I'll look into it when I get the chance.
Thanks,
/ravi
|
|
|
|
|
|
|
Why? What i'm doing wrong? I just dowload the source code and run. I don't understand...
This is the file that I can get through the url.
[[["Avoir une très bonne journée !","Have a very good day!","",""]],,"en",,[["Avoir",[1],true,false,690,0,1,0],["une très bonne journée",[2],true,false,690,1,5,0],["!",[3],false,false,998,5,6,0]],[["Have",1,[["Avoir",690,true,false],["Ont",0,true,false],["Passez",0,true,false],["Avez",0,true,false],["Vous avez des",0,true,false]],[[0,4]],"Have a very good day!"],["a very good day",2,[["une très bonne journée",690,true,false],["une bonne journée",0,true,false],["une excellente journée",0,true,false]],[[5,20]],""],["!",3,[["!",998,false,false]],[[20,21]],""]],,,[["en"]],139]
|
|
|
|
|