diff --git a/docs/.ja/guide/advanced/function.md b/docs/.ja/guide/advanced/function.md index 87902b412..565f8dc92 100644 --- a/docs/.ja/guide/advanced/function.md +++ b/docs/.ja/guide/advanced/function.md @@ -188,12 +188,12 @@ const messages = { Template: ```html -

{{ $tc('car', 1) }}

-

{{ $tc('car', 2) }}

+

{{ $t('car', 1) }}

+

{{ $t('car', 2) }}

-

{{ $tc('apple', 0) }}

-

{{ $tc('apple', 1) }}

-

{{ $tc('apple', 10, { count: 10 }) }}

+

{{ $t('apple', 0) }}

+

{{ $t('apple', 1) }}

+

{{ $t('apple', { count: 10 }, 10) }}

``` Output is the below: @@ -207,4 +207,4 @@ Output is the below:

10 apples

``` -You need to specify the key that resolves the value specified with `$tc` or `tc`. +You need to specify the key that resolves the value specified with `$t` or `t`. diff --git a/docs/.ja/guide/essentials/pluralization.md b/docs/.ja/guide/essentials/pluralization.md index 22652bf85..f0d0ba7d0 100644 --- a/docs/.ja/guide/essentials/pluralization.md +++ b/docs/.ja/guide/essentials/pluralization.md @@ -49,7 +49,7 @@ Vue I18nでは、いくつかの複数化の方法が提供されます。ここ

{{ $tc('apple', 0) }}

{{ $tc('apple', 1) }}

-

{{ $tc('apple', 10, { count: 10 }) }}

+

{{ $tc('apple', { count: 10 }, 10) }}

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

{{ $tc('banana', 1, { n: 1 }) }}

{{ $tc('banana', 1) }}

-

{{ $tc('banana', 100, { n: 'too many' }) }}

+

{{ $tc('banana', { n: 'too many' }, 100) }}

``` 上記の例では、第1引数にロケールメッセージのキー、第2引数に数値またはオブジェクトを指定しています。 diff --git a/docs/guide/advanced/function.md b/docs/guide/advanced/function.md index 87902b412..565f8dc92 100644 --- a/docs/guide/advanced/function.md +++ b/docs/guide/advanced/function.md @@ -188,12 +188,12 @@ const messages = { Template: ```html -

{{ $tc('car', 1) }}

-

{{ $tc('car', 2) }}

+

{{ $t('car', 1) }}

+

{{ $t('car', 2) }}

-

{{ $tc('apple', 0) }}

-

{{ $tc('apple', 1) }}

-

{{ $tc('apple', 10, { count: 10 }) }}

+

{{ $t('apple', 0) }}

+

{{ $t('apple', 1) }}

+

{{ $t('apple', { count: 10 }, 10) }}

``` Output is the below: @@ -207,4 +207,4 @@ Output is the below:

10 apples

``` -You need to specify the key that resolves the value specified with `$tc` or `tc`. +You need to specify the key that resolves the value specified with `$t` or `t`. diff --git a/docs/guide/essentials/pluralization.md b/docs/guide/essentials/pluralization.md index 12fcaa14d..cc7c2d898 100644 --- a/docs/guide/essentials/pluralization.md +++ b/docs/guide/essentials/pluralization.md @@ -25,34 +25,33 @@ The `car` has `car | cars` pluralization message, while the `apple` has `no appl 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. -Vue I18n offers some ways to support pluralization. Here we’ll use the `$tc`. +Vue I18n offers some ways to support pluralization. Here we’ll use the `$t`. :::tip NOTE -`$tc` has some overloads. About these overloads, see the [API Reference](../../api/injection#tc-key) +`$t` has some overloads. About these overloads, see the [API Reference](../../api/injection#t-key) ::: :::tip NOTE Some ways to support pluralization are: -- `$tc` (for Legacy API mode) +- injected gloal `$t` - `v-t` custom directive - built-in Translation component (`i18n-t`) - exported `t` from `useI18n` (for Composition API mode) -- injected global `$t` (for Composition API mode) ::: The following is an example of using the translation API. ```html -

{{ $tc('car', 1) }}

-

{{ $tc('car', 2) }}

+

{{ $t('car', 1) }}

+

{{ $t('car', 2) }}

-

{{ $tc('apple', 0) }}

-

{{ $tc('apple', 1) }}

-

{{ $tc('apple', 10, { count: 10 }) }}

+

{{ $t('apple', 0) }}

+

{{ $t('apple', 1) }}

+

{{ $t('apple', 10, { count: 10 }) }}

``` -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. +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. As result the below: @@ -91,12 +90,12 @@ The number can be accessed within locale messages via predefined named arguments The following is an example of using `$tc`: ```html -

{{ $tc('apple', 10, { count: 10 }) }}

-

{{ $tc('apple', 10) }}

+

{{ $t('apple', 10, { count: 10 }) }}

+

{{ $t('apple', 10) }}

-

{{ $tc('banana', 1, { n: 1 }) }}

-

{{ $tc('banana', 1) }}

-

{{ $tc('banana', 100, { n: 'too many' }) }}

+

{{ $t('banana', 1, { n: 1 }) }}

+

{{ $t('banana', 1) }}

+

{{ $t('banana', 100, { n: 'too many' }) }}

``` 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: ```html

Car:

-

{{ $tc('car', 1) }}

-

{{ $tc('car', 2) }}

-

{{ $tc('car', 4) }}

-

{{ $tc('car', 12) }}

-

{{ $tc('car', 21) }}

+

{{ $t('car', 1) }}

+

{{ $t('car', 2) }}

+

{{ $t('car', 4) }}

+

{{ $t('car', 12) }}

+

{{ $t('car', 21) }}

Banana:

-

{{ $tc('banana', 0) }}

-

{{ $tc('banana', 4) }}

-

{{ $tc('banana', 11) }}

-

{{ $tc('banana', 31) }}

+

{{ $t('banana', 0) }}

+

{{ $t('banana', 4) }}

+

{{ $t('banana', 11) }}

+

{{ $t('banana', 31) }}

``` As result the below: diff --git a/examples/legacy/functions/plural.html b/examples/legacy/functions/plural.html index 8fcb5d6d9..fd8bf6756 100644 --- a/examples/legacy/functions/plural.html +++ b/examples/legacy/functions/plural.html @@ -9,17 +9,17 @@

Car:

-

{{ $tc('car', 1) }}

-

{{ $tc('car', 2) }}

+

{{ $t('car', 1) }}

+

{{ $t('car', 2) }}

Apple:

-

{{ $tc('apple', 0) }}

-

{{ $tc('apple', 1) }}

-

{{ $tc('apple', 10, { count: 10 }) }}

-

{{ $tc('apple', 10) }}

+

{{ $t('apple', 0) }}

+

{{ $t('apple', 1) }}

+

{{ $t('apple', { count: 10 }, 10) }}

+

{{ $t('apple', 10) }}

Banana:

-

{{ $tc('banana', 1, { n: 1 }) }}

-

{{ $tc('banana', 1) }}

-

{{ $tc('banana', 100, { n: 'too many' }) }}

+

{{ $t('banana', { n: 1 }, 1) }}

+

{{ $t('banana', 1) }}

+

{{ $t('banana', { n: 'too many' }, 100) }}