Skip to content

Two Mi18n

Minimalist Javascript library for internationalization in only two methods. Too minimalist.
<script defer src="https://unpkg.com/two-mi18n@latest/dist/TwoMi18n.umd.js"></script>
...
<p data-twomi18n="hello-world">Hello world</p>
...
<script>
const twoMi18n = new TwoMi18n({
default: "en",
translations: {
en: {
"hello-world": "Hello world",
},
fr: {
"hello-world": "Bonjour le monde",
},
},
});
console.log(twoMi18n.translate("hello-world", "fr")); //Bonjour le monde
twoMi18n.translateHTML("fr");
</script>

See how it’s work here.

Hello World

Simple, lightweight and easy to use

Two Mi18n is a Javascript library for translating websites directly on the client. The goal of this library is to provide the easiest way to translate any website.

  • Minimalist and easy to use: Only two methods
  • Lightweight: ~1.6 KB minified
  • Client-side oriented