如何将我的网页翻译成其他语言?

Alo*_*Leo 3 html javascript webpage translate

我该如何翻译我的网页?实际上应该使用什么技术或什么脚本 - 如果需要?有关信息; 我有所有翻译的文字.但我不想为其他语言创建类似克隆网站的东西.我只使用javascript - 包括jquery.

dru*_*dge 8

只是使用JavaScript ...

<script type="text/javascript">

// JSON-formatted, potentially read from a database
var article = {
    title: {
      en_US: "Article Title",
      fr_FR: "Titre de l\'Article"
    },
    content: {
      en_US: "Content of the Article.",
      fr_FR: "Contenu de l\'Article."
    }
}

// simple function to write the info to the page
function get_i18n(item, lang) {
    document.write(article[item][lang]);
}
</script>

<!-- English Version -->
<div class="story">
   <h1 class="title"><script>get_i18n('title','en_US');</script></h1>
   <p class="content"><script>get_i18n('content','en_US');</script></p>
</div>

<!-- French Version -->
<div class="story">
   <h1 class="title"><script>get_i18n('title','fr_FR');</script></h1>
   <p class="content"><script>get_i18n('content','fr_FR');</script></p>
</div>
Run Code Online (Sandbox Code Playgroud)

请注意:这不是一个非常优雅的解决方案.我确信有一个更漂亮的方法......