Skip to content

Commit 2f57ab2

Browse files
committed
docs: not use deprecated api
1 parent 73f9e88 commit 2f57ab2

File tree

3 files changed

+35
-36
lines changed

3 files changed

+35
-36
lines changed

docs/.ja/guide/advanced/function.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@ const messages = {
188188
Template:
189189

190190
```html
191-
<p>{{ $tc('car', 1) }}</p>
192-
<p>{{ $tc('car', 2) }}</p>
191+
<p>{{ $t('car', 1) }}</p>
192+
<p>{{ $t('car', 2) }}</p>
193193

194-
<p>{{ $tc('apple', 0) }}</p>
195-
<p>{{ $tc('apple', 1) }}</p>
196-
<p>{{ $tc('apple', 10, { count: 10 }) }}</p>
194+
<p>{{ $t('apple', 0) }}</p>
195+
<p>{{ $t('apple', 1) }}</p>
196+
<p>{{ $t('apple', 10, { count: 10 }) }}</p>
197197
```
198198

199199
Output is the below:
@@ -207,4 +207,4 @@ Output is the below:
207207
<p>10 apples</p>
208208
```
209209

210-
You need to specify the key that resolves the value specified with `$tc` or `tc`.
210+
You need to specify the key that resolves the value specified with `$t` or `t`.

docs/guide/advanced/function.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@ const messages = {
188188
Template:
189189

190190
```html
191-
<p>{{ $tc('car', 1) }}</p>
192-
<p>{{ $tc('car', 2) }}</p>
191+
<p>{{ $t('car', 1) }}</p>
192+
<p>{{ $t('car', 2) }}</p>
193193

194-
<p>{{ $tc('apple', 0) }}</p>
195-
<p>{{ $tc('apple', 1) }}</p>
196-
<p>{{ $tc('apple', 10, { count: 10 }) }}</p>
194+
<p>{{ $t('apple', 0) }}</p>
195+
<p>{{ $t('apple', 1) }}</p>
196+
<p>{{ $t('apple', 10, { count: 10 }) }}</p>
197197
```
198198

199199
Output is the below:
@@ -207,4 +207,4 @@ Output is the below:
207207
<p>10 apples</p>
208208
```
209209

210-
You need to specify the key that resolves the value specified with `$tc` or `tc`.
210+
You need to specify the key that resolves the value specified with `$t` or `t`.

docs/guide/essentials/pluralization.md

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,34 +25,33 @@ The `car` has `car | cars` pluralization message, while the `apple` has `no appl
2525

2626
These plural messages are selected by the logic of the choice rule for each language in the translaton API according to the numeric value you specify at the translation API.
2727

28-
Vue I18n offers some ways to support pluralization. Here we’ll use the `$tc`.
28+
Vue I18n offers some ways to support pluralization. Here we’ll use the `$t`.
2929

3030
:::tip NOTE
31-
`$tc` has some overloads. About these overloads, see the [API Reference](../../api/injection#tc-key)
31+
`$t` has some overloads. About these overloads, see the [API Reference](../../api/injection#t-key)
3232
:::
3333

3434
:::tip NOTE
3535
Some ways to support pluralization are:
3636

37-
- `$tc` (for Legacy API mode)
37+
- injected gloal `$t`
3838
- `v-t` custom directive
3939
- built-in Translation component (`i18n-t`)
4040
- exported `t` from `useI18n` (for Composition API mode)
41-
- injected global `$t` (for Composition API mode)
4241
:::
4342

4443
The following is an example of using the translation API.
4544

4645
```html
47-
<p>{{ $tc('car', 1) }}</p>
48-
<p>{{ $tc('car', 2) }}</p>
46+
<p>{{ $t('car', 1) }}</p>
47+
<p>{{ $t('car', 2) }}</p>
4948

50-
<p>{{ $tc('apple', 0) }}</p>
51-
<p>{{ $tc('apple', 1) }}</p>
52-
<p>{{ $tc('apple', 10, { count: 10 }) }}</p>
49+
<p>{{ $t('apple', 0) }}</p>
50+
<p>{{ $t('apple', 1) }}</p>
51+
<p>{{ $t('apple', 10, { count: 10 }) }}</p>
5352
```
5453

55-
In the above example of using the `$tc`, the first argument is the locale messages key and the second argument is a number. The `$tc` returns the choice message as a result.
54+
In the above example of using the `$t`, the first argument is the locale messages key and the second argument is a number. The `$t` returns the choice message as a result.
5655

5756
As result the below:
5857

@@ -91,12 +90,12 @@ The number can be accessed within locale messages via predefined named arguments
9190
The following is an example of using `$tc`:
9291

9392
```html
94-
<p>{{ $tc('apple', 10, { count: 10 }) }}</p>
95-
<p>{{ $tc('apple', 10) }}</p>
93+
<p>{{ $t('apple', 10, { count: 10 }) }}</p>
94+
<p>{{ $t('apple', 10) }}</p>
9695

97-
<p>{{ $tc('banana', 1, { n: 1 }) }}</p>
98-
<p>{{ $tc('banana', 1) }}</p>
99-
<p>{{ $tc('banana', 100, { n: 'too many' }) }}</p>
96+
<p>{{ $t('banana', 1, { n: 1 }) }}</p>
97+
<p>{{ $t('banana', 1) }}</p>
98+
<p>{{ $t('banana', 100, { n: 'too many' }) }}</p>
10099
```
101100

102101
In the above some examples, the first argument is the locale messages key and the second argument is the numeric value or object.
@@ -169,17 +168,17 @@ With the following template:
169168

170169
```html
171170
<h2>Car:</h2>
172-
<p>{{ $tc('car', 1) }}</p>
173-
<p>{{ $tc('car', 2) }}</p>
174-
<p>{{ $tc('car', 4) }}</p>
175-
<p>{{ $tc('car', 12) }}</p>
176-
<p>{{ $tc('car', 21) }}</p>
171+
<p>{{ $t('car', 1) }}</p>
172+
<p>{{ $t('car', 2) }}</p>
173+
<p>{{ $t('car', 4) }}</p>
174+
<p>{{ $t('car', 12) }}</p>
175+
<p>{{ $t('car', 21) }}</p>
177176

178177
<h2>Banana:</h2>
179-
<p>{{ $tc('banana', 0) }}</p>
180-
<p>{{ $tc('banana', 4) }}</p>
181-
<p>{{ $tc('banana', 11) }}</p>
182-
<p>{{ $tc('banana', 31) }}</p>
178+
<p>{{ $t('banana', 0) }}</p>
179+
<p>{{ $t('banana', 4) }}</p>
180+
<p>{{ $t('banana', 11) }}</p>
181+
<p>{{ $t('banana', 31) }}</p>
183182
```
184183

185184
As result the below:

0 commit comments

Comments
 (0)