# Locale changing

{% hint style="warning" %}
Notice

<mark style="color:yellow;">⚠</mark> Locale changing is ignored for components that use `sync:` **false**.
{% endhint %}

### Information

The default language is set in the user's local storage.

### Changing

Default configuration

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

Vue3 component

```html
<template>
  <div>
    <p>{{$t("welcome",{user:"Ricea"})}}</p>
    <button @click="changelocale">Change to ro - {{count}}</button>
  </div>
</template>
<script>
export default {
  data() {
    return {
      count: 0
    }
  },
  methods:{
    changelocale(){
      this.count++;
      this.$lang.changeLocale("ro-RO");
    }
  },
}
</script>
```

Output:

* Before change

```html
<template>
  <div>
    <p>Welcome, Ricea!</p>
    <button @click="changelocale">Change to ro - 0</button>
  </div>
</template>
```

* After change

```html
<template>
  <div>
    <p>Bine ati venit, Ricea!</p>
    <button @click="changelocale">Change to ro - 0</button>
  </div>
</template>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://raul202.gitbook.io/vue3-multilang/guide/locale-changing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
