开发者

Change website language

开发者 https://www.devze.com 2022-12-09 20:45 出处:网络
string text = \"我喜欢跑步。\"; TranslateClient client = new TranslateClient(/* Enter the URL of开发者_Python百科 your site here */);
string text = "我喜欢跑步。";
TranslateClient client = new TranslateClient(/* Enter the URL of开发者_Python百科 your site here */);
string translated = client.Translate(text, Language.ChineseSimplified, Language.English);
Console.WriteLine(translated);  // I like running.

It is working fine. But I want to pass whole site as an input and convert into selected language. How can I do this?

Ex : http://translate.google.com/#


You may need to fetch the page contents yourself, for instance using HttpRequest, strip it by HTML elements (with a simple regular expression), then feed it the text to code that does the translation.

0

精彩评论

暂无评论...
验证码 换一张
取 消