Is it possible to auto-translate an Iframe with google translation?

丶灬走出姿态 提交于 2019-12-24 14:25:32

问题


I'd like to translate to french an iframe on my website automatically when users come to that page : http://www.julienlussiez.com/p/boutique.html

Is it possible?

Here's the code:

<iframe height="525px" scrolling="no" src="http://julienlussiez.bandcamp.com/album/fragile" width="950px"></iframe>

Thanks


回答1:


In general, I'd say just set the src of your iframe to this: http://translate.google.com/translate?hl=fr&sl=auto&tl=fr&u=BLANK

Where BLANK is the url of the website.

However, it doesn't seem to work for the website you're looking at, since Google thinks its already in French...




回答2:


(Oct 2014:) Google translate does not allow an iframe to be translated. They are happy to translate the complete window, though, and then the URL for your specific case could be something like:

http://www.google.com/translate?hl=fr&ie=UTF8&sl=en&tl=fr&u=http%3A%2F%2Fjulienlussiez.bandcamp.com%2Falbum%2Ffragile

sl means source language, so sl=en is a declaration that you believe the source is in English. tl means target language, so tl=fr means that you request a French translation. I believe that hl means human interface language, i.e. with that parameter you request and comments, buttons etc from google to be in a specific language. (French in this case).



来源:https://stackoverflow.com/questions/15622495/is-it-possible-to-auto-translate-an-iframe-with-google-translation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!