开发者

How to do automatic Google translation on page load?

Is there any way to do automatic translation of a page where I have inserted that Google translation code? Normally user has to select a certain language and then Google translates it, but what I want is, after the page is loaded, it automatically does translation of a pre-defined la开发者_开发知识库nguage. Is there a way I can pass hard coded language name to Google javascript function which translates the document?

Thanks


I've used the jQuery Translate library to do this before. Notwithstanding the general limitations of automated translation, it worked pretty well.

Take a look here. You can use jQuery's selector mechanism to determine which content gets auto-translated on page load (something like $('body').translate('english');).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜