Using Bing Translation in .NET

Sometimes it can be convenient to translate text into your applications. For this Microsoft offers a (free) translation service, Microsoft Translator. To use this service it takes only a few quick steps.

  1. Go to http://www.bing.com/developers and create an account. You will get an ID to use the service.
  2. Create a new project with Visual Studio
  3. Add a reference to au service. The address of the service is: http://api.microsofttranslator.com/V2/Soap.svc

Add a service reference

  1. Use the service in your application!
LanguageServiceClient service = new LanguageServiceClient();
const string text = "Texte à traduire en anglais.";
const string appId = "Votre AppId";
Console.WriteLine(service.Translate(appId, text, "fr", "en"));

For details of the functions offered by the service: http://msdn.microsoft.com/en-us/library/ff512435(v=MSDN.10).aspx

Enjoy this blog? Buy Me A Coffee Donate with PayPal

Leave a reply