translater.js
♣︎ This is a use of HTML comments page translation solution. For a small amount of static pages, this solution is more simple. it has no dependents, Compression only (~2KB) Official document demo preview.
- Support
IMG``text
switching - Support
URL
parameter switching language - Support local cache selection
Usage
$ npm install translater.js
import 'translater.js';
Or manually download and link translater.js in your HTML, It can also be downloaded via UNPKG:
这里是中文 <!--{jp}ここは日本語です--> <!--{en}Here is English-->
The method of switching languages via hyperlinks.
English日本語中文
You can set the language parameter passed through URL.
http://127.0.0.1:9005/test/test.html?lang=jp
API
Adding text translation
这里是中文 <!--{jp}ここは日本語です--> <!--{en}Here is English-->
Picture switch
Input
getLang/setLang
Get or set the current languge.