我们网站的管理员方面生成了一个段落(因此无法事先知道内容)。
内容可以使用不同的语言。我想将本段的翻译显示在另一段中。最好使用谷歌翻译。
答案 0 :(得分:1)
你得到了投票,因为我们不是在这里做所有代码,你必须尝试一些思考或在谷歌上找到解决方案才能发布你的问题......
这是一个使用google translate api翻译定义div的工作解决方案,在尝试之前需要API密钥:
<script src="https://www.google.com/jsapi?key=YOUR_GOOGLE_KEY"></script>
<div id="languages"><p>
<a href="?lang=en" rel="en">English</a> / <a href="?lang=es" rel="es">Spanish</a> / <a href="?lang=it" rel="it">Italian</a> /
<a href="?lang=fr" rel="fr">French</a>
</p></div>
<div id="languageBlock">
<p>Lights go out and I can't be saved <br />
Tides that I tried to swim against <br />
Brought me down upon my knees <br />
Oh I beg, I beg and plead </p>
<p>Singin', come out if things aren't said <br />
Shoot an apple off my head <br />
And a, trouble that can't be named <br />
Tigers waitin' to be tamed </p>
<p>Singing, yooooooooooooo ohhhhhh <br />
Yoooooooooooo ohhhhhh </p>
<p>Home, home, where I wanted to go <br />
Home, home, where I wanted to go <br />
Home, home, where I wanted to go <br />
Home, home, where I wanted to go</p>
</div>