simple-mus
v1.0.3
Published
client-side multilingual support
Downloads
2
Maintainers
Readme
This is very simple client side translator for multilingual support. just use it very simple.
===========================================================================
Install
Node
npm i simple-mus
CDN
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dest/src/index.min.js"></script>
Download link: ...
<script src="/static/js/simple_mus.js"></script>
===========================================================================
Usage
<h1 class="_translate"> Hello </h1>
===========================================================================
const language_maps = {
ko: {
"Hello": "안녕하세요"
},
jp: {
"Hello": "こんにちは"
},
cn: {
"Hello" : "你好"
}
};
const simple_ms = simpleMUS();
window.addEventListener("DOMContentLoaded", ()=>{
setLanguageCode("ko");
simple_ms.translate(language_maps);
});
</script>
<!-- en -->
<h1>Hello</h1>
<!-- ko -->
<h1>안녕하세요</h1>
<!-- jp -->
<h1>こんにちは</h1>
<!-- cn -->
<h1>你好</h1>