
Google Translate for .NET
Follows an example on how to use the code implemented in
http://code.google.com/p/gtapi/ to easily translate a String in C#, using the Google Translation Service in one of its tens of possible language combinations,
Code:
using System;
using System.Collections.Generic;
using System.Text;
using Google.API;
using Google.API.Translate;
namespace TesteDoGoogleTranslate
{
class Program
{
static void Main(string[] args)
{
System.Console.WriteLine(Translator.Translate(”testando a tradução automática.”, Language.Portuguese, Language.English, TranslateFormat.text));
}
}
}
This test should print the Portuguese phrase ”testando a tradução automática.” as,
“testing the automatic translation.”
Just to note - Do not rely in it, the machine translation is far from perfect - but that can be used as base for more complex projects.