Reputation: 85765
I don't get this example
string text = "我喜欢跑步。";
TranslateClient client = new TranslateClient(/* Enter the URL of your site here */);
string translated = client.Translate(text, Language.ChineseSimplified, Language.English);
Console.WriteLine(translated);
// I like running.
It "says enter the url of your site here". I thought that is the site you want to translate but then the next line takes in some text to translate. I don't get it. Do I first have to download the page somehow then translate it? Is there no translate entire page?
Edit
It does not seem possible. It also seems I have to pay for this library to use it. Is there any free ones out there?
Upvotes: 0
Views: 929
Reputation: 284816
The URL in question is the site that's running the code. So if foo.com uses TranslateClient, "foo.com" should be the parameter. The text is the actual text you want to translate, as shown in the example.
I don't think it will translate a URL the way the web interface does, but I haven't tested.
Also, the API is no longer available for free use, and it looks like TranslateClient won't work for that, since it doesn't take a key.
You can look at whether the website translator would meet your needs.
Upvotes: 2