Skip to content

Commit 0c00d44

Browse files
committed
docs: Add documentation about loadLanguageAsync method.
1 parent 218f762 commit 0c00d44

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

README.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ createApp().use(i18nVue, {
5454
})
5555
```
5656

57-
### trans()
57+
### `trans()`
5858

5959
The `trans()` method can be used on
6060

@@ -71,3 +71,16 @@ trans('Welcome!'); // Bem-vindo!
7171
trans('Welcome, :name!', { name: 'Francisco' }) // Bem-vindo Francisco!
7272
trans('Welcome, :NAME!', { name: 'Francisco' }) // Bem-vindo FRANCISCO!
7373
```
74+
75+
### `loadLanguageAsync()`
76+
77+
The `loadLanguageAsync()` can be used to change the location during the runtime.
78+
79+
```jsx
80+
import { loadLanguageAsync } from 'laravel-vue-i18n';
81+
82+
<template>
83+
<div>{{ $t('Welcome!') }}</div>
84+
<button @click="() => loadLanguageAsync('pt')">Change to Portuguese Language</button>
85+
</template>
86+
```

0 commit comments

Comments
 (0)