Getting current locale

To obtain the current language must be used options property in $lang

Example

Default configuration

app.use(createMultilang(),{
    locale: "en-UK",
    messages,
})

Vue3 component

<template>
  <div>
    <p>{{$lang.options.locale}}</p>
  </div>
</template>

Output

<template>
  <div>
    <p>en-UK</p>
  </div>
</template>

Last updated