Follows an example on how to use the code implemented in 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.
Users browsing this forum: No registered users and 0 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum