Getting started

HTML

<div id="app">
  <p>{{ $t("welcome") }}</p>
</div>

JAVASCRIPT/ TYPESCRIPT

import { createApp } from 'vue'
import App from './App.vue'
import createMultilang from "vue3multilang"
const app = createApp(App)
const messages = {
    "en-UK":{
        welcome:"Welcome!",
    },
    "ro-RO":{
        welcome:"Bine ati venit!",
    }
}
app.use(createMultilang(),{
    locale: "en-UK",
    messages,
})
app.mount('#app')

Output:

<div id="#app">
  <p>Welcome!</p>
</div>

Last updated