This article shows you how to translate text in Microsoft’s .net language: C#.
To translate textual natural languages (e.g. from English to Tamil) in C#, do this:
- Copy the following source code to the main class in your Console Application in Visual Studio.
- Specify your translation requirements on lines 19 through 22.
- Add the reference “System.Web.Extensions” by doing this:
- Right-click on your project node in the Solution Explorer panel.
- Choose “Add” -> “Reference…”
- Choose “Framework” on the left pane.
- Look for “System.Web.Extensions” in the middle pane. Check the checkbox in front of it.
- Click OK.
- Build and run the application in Visual Studio.
Looking for your language code? See the complete listing.
The trial account only allows you to call the translation API up to 10 times for learning purpose. Subscribe to a Premium plan to use the translation API seriously.
Want to translate text in another programming language? Check out the Translation API page.