Mytory i18n Library

A lightweight library that makes multilingual UI easy with simple `data-mi18n` attributes. You can test default language setup, runtime option changes, and language switching APIs right here.

Basic Example (EN Default)

English default page with Korean `data-mi18n-ko` attributes.

Basic Example (KO Default)

Korean default page with English translations and language-switch API demo.

Hash Switch Example

Real-time language switching and history sync using URL hashes (#mi18n-ko).

Query & History Example

Language switching via query parameters and History API (pushState) sync.

Download

Language Switch Demo

Click a button to switch language with `setLanguage()`, and check `getLanguage()` output below.

Current language: checking...
<script src="./mytory-i18n.js?v=20260510"></script>
<script>
  MytoryI18n.init({
    defaultLang: "ko",
    allowHtml: true
  });

  // later
  MytoryI18n.setLanguage("en");
</script>