Skip to content

Commit

Permalink
docs: Add documentation about loadLanguageAsync method.
Browse files Browse the repository at this point in the history
  • Loading branch information
xiCO2k committed Nov 18, 2021
1 parent 218f762 commit 0c00d44
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ createApp().use(i18nVue, {
})
```

### trans()
### `trans()`

The `trans()` method can be used on

Expand All @@ -71,3 +71,16 @@ trans('Welcome!'); // Bem-vindo!
trans('Welcome, :name!', { name: 'Francisco' }) // Bem-vindo Francisco!
trans('Welcome, :NAME!', { name: 'Francisco' }) // Bem-vindo FRANCISCO!
```

### `loadLanguageAsync()`

The `loadLanguageAsync()` can be used to change the location during the runtime.

```jsx
import { loadLanguageAsync } from 'laravel-vue-i18n';

<template>
<div>{{ $t('Welcome!') }}</div>
<button @click="() => loadLanguageAsync('pt')">Change to Portuguese Language</button>
</template>
```

0 comments on commit 0c00d44

Please sign in to comment.