How to localize a simple HTML website page in my case?

前端 未结 11 625
没有蜡笔的小新
没有蜡笔的小新 2020-12-01 04:34

I am NOT developing any web service application which contain client side and backend server side (like java EE application or Ruby on Rai

11条回答
  •  温柔的废话
    2020-12-01 05:12

    I read ceving's answer, and then write a JS library languages.js to do this.

    I change the sequence of </code>s' with different languages, so it works if you want to switch lang in the page title.</p> <p>Write HTML like this:</p> <pre><code><html> <head> <title lang="en">Test Page 测试页面 テストページ miaw miaw miaw

    Why does the sun rise? Why does the moon shine?
    太阳为什么会升起?月亮为什么会发光?
    太陽はなんで昇る?月はなぜ輝く?
    miaw miaw miaw miaw miaw miaw miaw miaw miaw miaw miaw miaw miaw

    Usage:

    Languages.select(lang);
    

    More detail: github readme

提交回复
热议问题