Skip to content

Commit 229cba8

Browse files
authored
docs: not use deprecated api (#2013)
* docs: not use deprecated api * fix: e2e * fix * fix
1 parent 73f9e88 commit 229cba8

File tree

7 files changed

+64
-65
lines changed

7 files changed

+64
-65
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', { count: 10 }, 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/.ja/guide/essentials/pluralization.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Vue I18nでは、いくつかの複数化の方法が提供されます。ここ
4949

5050
<p>{{ $tc('apple', 0) }}</p>
5151
<p>{{ $tc('apple', 1) }}</p>
52-
<p>{{ $tc('apple', 10, { count: 10 }) }}</p>
52+
<p>{{ $tc('apple', { count: 10 }, 10) }}</p>
5353
```
5454

5555
上の`$tc`の使用例では、第1引数にロケールメッセージキー、第2引数に数字を指定しています。
@@ -96,7 +96,7 @@ const messages = {
9696

9797
<p>{{ $tc('banana', 1, { n: 1 }) }}</p>
9898
<p>{{ $tc('banana', 1) }}</p>
99-
<p>{{ $tc('banana', 100, { n: 'too many' }) }}</p>
99+
<p>{{ $tc('banana', { n: 'too many' }, 100) }}</p>
100100
```
101101

102102
上記の例では、第1引数にロケールメッセージのキー、第2引数に数値またはオブジェクトを指定しています。

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', { count: 10 }, 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:

examples/legacy/functions/plural.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
<body>
1010
<div id="app">
1111
<h2>Car:</h2>
12-
<p class="p1">{{ $tc('car', 1) }}</p>
13-
<p class="p2">{{ $tc('car', 2) }}</p>
12+
<p class="p1">{{ $t('car', 1) }}</p>
13+
<p class="p2">{{ $t('car', 2) }}</p>
1414
<h2>Apple:</h2>
15-
<p class="p3">{{ $tc('apple', 0) }}</p>
16-
<p class="p4">{{ $tc('apple', 1) }}</p>
17-
<p class="p5">{{ $tc('apple', 10, { count: 10 }) }}</p>
18-
<p class="p6">{{ $tc('apple', 10) }}</p>
15+
<p class="p3">{{ $t('apple', 0) }}</p>
16+
<p class="p4">{{ $t('apple', 1) }}</p>
17+
<p class="p5">{{ $t('apple', { count: 10 }, 10) }}</p>
18+
<p class="p6">{{ $t('apple', 10) }}</p>
1919
<h2>Banana:</h2>
20-
<p class="p7">{{ $tc('banana', 1, { n: 1 }) }}</p>
21-
<p class="p8">{{ $tc('banana', 1) }}</p>
22-
<p class="p9">{{ $tc('banana', 100, { n: 'too many' }) }}</p>
20+
<p class="p7">{{ $t('banana', { n: 1 }, 1) }}</p>
21+
<p class="p8">{{ $t('banana', 1) }}</p>
22+
<p class="p9">{{ $t('banana', { n: 'too many' }, 100) }}</p>
2323
</div>
2424
<script>
2525
const { createApp } = Vue

examples/legacy/plural/basic.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
<body>
1010
<div id="app">
1111
<h2>Car:</h2>
12-
<p class="p1">{{ $tc('car', 1) }}</p>
13-
<p class="p2">{{ $tc('car', 2) }}</p>
12+
<p class="p1">{{ $t('car', 1) }}</p>
13+
<p class="p2">{{ $t('car', 2) }}</p>
1414
<h2>Apple:</h2>
15-
<p class="p3">{{ $tc('apple', 0) }}</p>
16-
<p class="p4">{{ $tc('apple', 1) }}</p>
17-
<p class="p5">{{ $tc('apple', 10, { count: 10 }) }}</p>
18-
<p class="p6">{{ $tc('apple', 10) }}</p>
15+
<p class="p3">{{ $t('apple', 0) }}</p>
16+
<p class="p4">{{ $t('apple', 1) }}</p>
17+
<p class="p5">{{ $t('apple', { count: 10 }, 10) }}</p>
18+
<p class="p6">{{ $t('apple', 10) }}</p>
1919
<h2>Banana:</h2>
20-
<p class="p7">{{ $tc('banana', 1, { n: 1 }) }}</p>
21-
<p class="p8">{{ $tc('banana', 1) }}</p>
22-
<p class="p9">{{ $tc('banana', 100, { n: 'too many' }) }}</p>
20+
<p class="p7">{{ $t('banana', { n: 1 }, 1) }}</p>
21+
<p class="p8">{{ $t('banana', 1) }}</p>
22+
<p class="p9">{{ $t('banana', { n: 'too many' }, 10) }}</p>
2323
</div>
2424
<script>
2525
const { createApp } = Vue

examples/legacy/plural/custom.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
<body>
1010
<div id="app">
1111
<h2>Car:</h2>
12-
<p class="p1">{{ $tc('car', 1) }}</p>
13-
<p class="p2">{{ $tc('car', 2) }}</p>
14-
<p class="p3">{{ $tc('car', 4) }}</p>
15-
<p class="p4">{{ $tc('car', 12) }}</p>
16-
<p class="p5">{{ $tc('car', 21) }}</p>
12+
<p class="p1">{{ $t('car', 1) }}</p>
13+
<p class="p2">{{ $t('car', 2) }}</p>
14+
<p class="p3">{{ $t('car', 4) }}</p>
15+
<p class="p4">{{ $t('car', 12) }}</p>
16+
<p class="p5">{{ $t('car', 21) }}</p>
1717

1818
<h2>Banana:</h2>
19-
<p class="p6">{{ $tc('banana', 0) }}</p>
20-
<p class="p7">{{ $tc('banana', 4) }}</p>
21-
<p class="p8">{{ $tc('banana', 11) }}</p>
22-
<p class="p9">{{ $tc('banana', 31) }}</p>
19+
<p class="p6">{{ $t('banana', 0) }}</p>
20+
<p class="p7">{{ $t('banana', 4) }}</p>
21+
<p class="p8">{{ $t('banana', 11) }}</p>
22+
<p class="p9">{{ $t('banana', 31) }}</p>
2323
</div>
2424
<script>
2525
const { createApp } = Vue

0 commit comments

Comments
 (0)