0

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.

kalls
  • 2,797
  • 17
  • 55
  • 75

2 Answers2

2

You can use a .NET API for this. Check http://code.google.com/p/google-language-api-for-dotnet/ for a specific one. Using Google Translate in C# has a list of available options.

Community
  • 1
  • 1
Pieter van Ginkel
  • 29,160
  • 8
  • 71
  • 111
  • Doing that for static strings though is absurd. – EboMike Oct 18 '10 at 18:35
  • 2
    He wants to store it to a new resource file. This is quite reasonable if you don't mind crappy translations. – Pieter van Ginkel Oct 18 '10 at 18:35
  • 1
    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 Oct 18 '10 at 18:39
  • 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 Oct 18 '10 at 18:40
0

Download MAT (Multilingual App Toolkit) for Visual Studio. https://marketplace.visualstudio.com/items?itemName=MultilingualAppToolkit.MultilingualAppToolkit-18308

This is the way to go to translate your projects in Visual Studio ;-)

juFo
  • 17,849
  • 10
  • 105
  • 142