tags:

views:

73

answers:

1

I have the following code

 private void button1_Click(object sender, EventArgs e)
    {
        ResXResourceReader resourceReader = new ResXResourceReader("EN-US.resx");

        foreach (DictionaryEntry dictonary in resourceReader)
        {
            //call google API to translate the entry
            MessageBox.Show(dictonary.Key.ToString() + ":\t" + dictonary.Value.ToString());
        }

        resourceReader.Close();
    }

In the above example I am reading a resource file and display it on the messagebox. I need to know how can I call google webservice or something and translate the entire resource file to a new language (french in my case) Please do let me know. I appreciate your support.

+2  A: 

You can use a .NET API for this. Check http://code.google.com/p/google-language-api-for-dotnet/ for a specific one. http://stackoverflow.com/questions/2246017/c-google-translate has a list of available options.

Pieter
Doing that for static strings though is absurd.
EboMike
He wants to store it to a new resource file. This is quite reasonable if you don't mind crappy translations.
Pieter
Ah, my bad. I interpreted that as calling Google Translate upon displaying a message box. Okay, better, although the translations are still going to be pretty whack. I guess that's certainly okay for a free application, but most likely not for a professional product.
EboMike
I have an application with so many resources files and the client wanted the website to be in french. So i am trying to come up with a utility by which I can read the resource file and translate and save it. Pieter already gave me an other option which involves manual work. It is in a seperate thread.
Kalls