Skip to content

Commit b225ee8

Browse files
committed
docs: Improve documentation
1 parent 961c049 commit b225ee8

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ createApp()
4040

4141
```html
4242
<template>
43-
<div>{{ $t('Hi all') }}</div>
43+
<div>
44+
<h1>{{ $t('Welcome :name!', { name: 'Francisco' }) }}. </h1>
45+
<div>Logged in {{ $tChoice('{1} :count minute ago|[2,*] :count minutes ago', 10) }}</div>
46+
</div>
4447
</template>
4548
```
4649

@@ -74,9 +77,10 @@ trans('Welcome, :name!', { name: 'Francisco' }) // Bem-vindo Francisco!
7477
trans('Welcome, :NAME!', { name: 'Francisco' }) // Bem-vindo FRANCISCO!
7578
```
7679

77-
### `trans_choice(message: string, count: number)`
80+
### `transChoice(message: string, count: number)`
7881

79-
The `trans_choice()` method can translate a given message based on a count.
82+
The `transChoice()` method can translate a given message based on a count,
83+
there is also available an `trans_choice` alias, and a mixin called `$tChoice()`.
8084

8185
```js
8286
// lang/pt.json
@@ -86,11 +90,11 @@ The `trans_choice()` method can translate a given message based on a count.
8690
"{1} :count minute ago|[2,*] :count minutes ago": "{1} há :count minuto|[2,*] há :count minutos",
8791
}
8892

89-
import { trans_choice } from 'laravel-vue-i18n';
93+
import { transChoice } from 'laravel-vue-i18n';
9094

91-
trans_choice('There is one apple|There are many apples', 1); // Existe uma maça
92-
trans_choice('{0} There are none|[1,19] There are some|[20,*] There are many', 19); // Tem algumas
93-
trans_choice('{1} :count minute ago|[2,*] :count minutes ago', 10); // Há 10 minutos.
95+
transChoice('There is one apple|There are many apples', 1); // Existe uma maça
96+
transChoice('{0} There are none|[1,19] There are some|[20,*] There are many', 19); // Tem algumas
97+
transChoice('{1} :count minute ago|[2,*] :count minutes ago', 10); // Há 10 minutos.
9498
```
9599

96100
### `loadLanguageAsync(lang: string)`

0 commit comments

Comments
 (0)