 |
|
 |
Hi Ravi,
I like your application. Its really great work. I want to do some modifications to the code. But failing to open the files in my visual basic version. Can you kindly say which version should i use to alter the code.
Thanks in advance
Regards
Dibyendu Biswas
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Thanks for your comments. 
The application's project should open with Visual Studio 2005, 2008 or 2010 (beta).
/ravi
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi
I dont have c#. I have only VB. Well I will try to get one. VB would have been better.
Well will this work for all 41 languages supported by google translate???
Will it be easy?
Regards
DB
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I saw the vb version... whose link you have given. But I dont know why it does not translate. Any Idea???
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Yes, it should be easy to convert it to support the other languages. Unfortunately I don't have the cycles to update the article right now but will do so when time permits.
/ravi
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi Ravi, The software works fine for me. However, it will be wonderful if it supports Japanese too.
How can I change the setting? I do not know how to change the code. Please help.
Thank you.
Alvin
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Good project.
This is what I did for Unicode (Thai) support. Get source for WebResourceProvider (http://www.codeproject.com/KB/IP/WebResourceProviderDotNet.aspx)
This example is adding Thai.
public enum Mode { ... EnglishToThai, ThaiToEnglish }
protected override string getPostData() { ... case Mode.EnglishToThai: strPostData += "en|th"; break; case Mode.ThaiToEnglish: strPostData += "th|en"; break;
void getContent (string url) { ... UTF8Encoding utf8Encoding = new UTF8Encoding(); byte[] postData = utf8Encoding.GetBytes(strPostData);
StreamReader streamReader = new StreamReader(stream, System.Text.Encoding.UTF8);
private void OnTranslate(object sender, System.EventArgs e) { ... else { if (radioThai.Checked) { mode = GoogleTranslator.Mode.EnglishToThai; reverseMode = GoogleTranslator.Mode.ThaiToEnglish; } }
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
 |
Hi Ravi
As you will have read in your other projects, I am hoping to achieve programmatic Japanese to English translation. I've given up trying to modify the MFC version of WebResourceProvider and will try to work with the .NET version instead as it apparently supports Unicode.
I changed the translation mode to en|ja, and successfully saw 'hello' translated to 'こんにちは' but the reverse translation (using ja|en) is displayed as '?????'. So I think there is something wrong with the local string handling.
Please will you suggest where I should look to fix this?
David
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I fixed this by changing:
ASCIIEncoding asciiEncoding = new ASCIIEncoding(); byte[] postData = asciiEncoding.GetBytes (strPostData);
to UTF8Encoding utf8Encoding = new UTF8Encoding(); byte[] postData = utf8Encoding.GetBytes(strPostData);
in WebResourceProvider.cs.
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
 |
This is great, except I don't know C#, I am using VB.NET, Is there a version for VB or can anyone convert it?
Thanks
El Chalateco
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Here's[^] a VB .NET version of WebResourceProvider. Perhaps you could use it to write a VB .NET version of GoogleTranslator by copying the parsing logic?
/ravi
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
 |
If I translate the sentence below from English to Spanish and back, part of the English sentence stays Spanish. Noticed this in my own code and in this project as well.
"This is a major weather alert. There is a tornado warning in effect until 9:00 pm today"
I also found that this sentence translates perfectly using the Google Translate site verses sending the web requests in Spanish and English. Any Idea what we might be missing?
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
 |
jwaldner wrote: sentence translates perfectly using the Google Translate site verses sending the web requests
Interesting... Will have to look into what's missing.
/ravi
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
in the example below adding and removing the line that sets the webClient encoding causes and fixes the problem for me...not sure why
public string TranslateText(string input, string languagePair) { string url = string.Format("http://www.google.com/translate_t?hl=en&ie=UTF8&text={0}&langpair={1}", input, languagePair);
WebClient webClient = new WebClient();
// this line makes the translation fail sometimes... webClient.Encoding = Encoding.UTF8; string result = webClient.DownloadString(url);
result = result.Substring(result.IndexOf("id=result_box") + 24, result.IndexOf("id=result_box") + 500);
result = result.Substring(0, result.IndexOf("</div"));
return result; }
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
 |
Dear Ravi,
First of congratulations for _thinking_ and then implementing a _poor man's_ translation tool that would enable developers to come out with their products supporting multiple languages easily. The response from the community itself is a proof of the _value_ this tool has to them.
I am posting my comment here, but I am actually working on C++ (MFC) so I would be more interested in your MFC component (WebResourceProvider) supporting Unicode. Ok - very quickly - I saw that Google Translation is supporting _11_ different languages translations and without any doubt the languages which don't need Unicode compliance quickly got translated using your tool (that I extended to support other languages).
The languages like Chinese (simplified and traditional), Japanese, Korean, Russian, Arabic obviously failed since they need Unicode to be able to represent their characters. Now I added (partially) the Unicode support to the MFC app (WebResourceProvider_Demo and Lib) and finally the code compiled with 0 errors, but as we know that's not enough - the translation then did _NOT_ work for any languages. I quickly saw that we are using _string length_ based calculations and surely in Unicode environment, they would start behaving strangely. I guess you need to look into it, so that then it becomes a very strong tool.
Recently I saw some posts here and you replying them that Unicode support is soon coming out. Could you please ensure that you add it in both of your tools MFC & C#? If I could be of any help by all means let me know.
Best regards, Yogesh Dhakad (Pune - India)
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Thanks for your comments. The MFC version of WRP is indeed sorely lacking Unicode support! I hope to be able to get to this soon. Will keep you posted.
/ravi
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hi Yogesh, I'm sorry but I haven't yet found the time to implement Unicode support for the MFC version. I'm completely swamped right now. 
/ravi
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |