Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breaking: drop $tc and tc #2017

Merged
merged 3 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
257 changes: 0 additions & 257 deletions docs/api/injection.md
Original file line number Diff line number Diff line change
Expand Up @@ -597,263 +597,6 @@ Overloaded `$rt`. About details, see the [$rt](injection#rt-message) remarks.

Translation message

### $tc(key)

:::danger NOTICE
**`$tc` has been deprecated in v10. Use `$t` instead. `$tc` is going to remove in v11.**
:::

Locale message pluralization

**Signature:**
```typescript
$tc(key: Key): TranslateResult;
```

:::warning NOTE
Supported for **Legacy API mode only**.
:::

**Details**

If this is used in a reactive context, it will re-evaluate once the locale changes.

The input / output is the same as for VueI18n instance. About that details, see [VueI18n#tc](legacy#tc-key).

The value of plural is handled with default `1`.

**See Also**
- [Pluralization](../guide/essentials/pluralization)

#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| key | Key | A target locale message key |

#### Returns

Translation message that is pluraled

### $tc(key, locale)

:::danger NOTICE
**`$tc` has been deprecated in v10. Use `$t` instead. `$tc` is going to remove in v11.**
:::

Locale message pluralization

**Signature:**
```typescript
$tc(key: Key, locale: Locale): TranslateResult;
```

:::warning NOTE
Supported for **Legacy API mode only**.
:::

**Details**

Overloaded `$tc`. About details, see the [$tc](injection#tc-key) remarks.

#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| key | Key | A target locale message key |
| locale | Locale | A locale, override locale that global scope or local scope |

#### Returns

Translation message that is pluraled

### $tc(key, list)

:::danger NOTICE
**`$tc` has been deprecated in v10. Use `$t` instead. `$tc` is going to remove in v11.**
:::

Locale message pluralization

**Signature:**
```typescript
$tc(key: Key, list: unknown[]): TranslateResult;
```

:::warning NOTE
Supported for **Legacy API mode only**.
:::

**Details**

Overloaded `$tc`. About details, see the [$tc](injection#tc-key) remarks.

#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| key | Key | A target locale message key |
| list | unknown[] | A values of list interpolation |

#### Returns

Translation message that is pluraled

### $tc(key, named)

:::danger NOTICE
**`$tc` has been deprecated in v10. Use `$t` instead. `$tc` is going to remove in v11.**
:::

Locale message pluralization

**Signature:**
```typescript
$tc(key: Key, named: Record<string, unknown>): TranslateResult;
```

:::warning NOTE
Supported for **Legacy API mode only**.
:::

**Details**

Overloaded `$tc`. About details, see the [$tc](injection#tc-key) remarks.

#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| key | Key | A target locale message key |
| named | Record&lt;string, unknown&gt; | A values of named interpolation |

#### Returns

Translation message that is pluraled

### $tc(key, choice)

:::danger NOTICE
**`$tc` has been deprecated in v10. Use `$t` instead. `$tc` is going to remove in v11.**
:::

Locale message pluralization

**Signature:**
```typescript
$tc(key: Key, choice: number): TranslateResult;
```

:::warning NOTE
Supported for **Legacy API mode only**.
:::

**Details**

Overloaded `$tc`. About details, see the [$tc](injection#tc-key) remarks.

#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| key | Key | A target locale message key |
| choice | number | Which plural string to get. 1 returns the first one |

#### Returns

Translation message that is pluraled

### $tc(key, choice, locale)

:::danger NOTICE
**`$tc` has been deprecated in v10. Use `$t` instead. `$tc` is going to remove in v11.**
:::

Locale message pluralization

**Signature:**
```typescript
$tc(key: Key, choice: number, locale: Locale): TranslateResult;
```

:::warning NOTE
Supported for **Legacy API mode only**.
:::

**Details**

Overloaded `$tc`. About details, see the [$tc](injection#tc-key) remarks.

#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| key | Key | A target locale message key |
| choice | number | Which plural string to get. 1 returns the first one |
| locale | Locale | A locale, override locale that global scope or local scope |

#### Returns

Translation message that is pluraled

### $tc(key, choice, list)

:::danger NOTICE
**`$tc` has been deprecated in v10. Use `$t` instead. `$tc` is going to remove in v11.**
:::

Locale message pluralization

**Signature:**
```typescript
$tc(key: Key, choice: number, list: unknown[]): TranslateResult;
```

:::warning NOTE
Supported for **Legacy API mode only**.
:::

**Details**

Overloaded `$tc`. About details, see the [$tc](injection#tc-key) remarks.

#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| key | Key | A target locale message key |
| choice | number | Which plural string to get. 1 returns the first one |
| list | unknown[] | A values of list interpolation |

#### Returns

Translation message that is pluraled

### $tc(key, choice, named)

:::danger NOTICE
**`$tc` has been deprecated in v10. Use `$t` instead. `$tc` is going to remove in v11.**
:::

Locale message pluralization

**Signature:**
```typescript
$tc(key: Key, choice: number, named: Record<string, unknown>): TranslateResult;
```

:::warning NOTE
Supported for **Legacy API mode only**.
:::

**Details**

Overloaded `$tc`. About details, see the [$tc](injection#tc-key) remarks.

#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| key | Key | A target locale message key |
| choice | number | Which plural string to get. 1 returns the first one |
| named | Record&lt;string, unknown&gt; | A values of named interpolation |

#### Returns

Translation message that is pluraled

### $te(key, locale)

Translation message exist
Expand Down
2 changes: 0 additions & 2 deletions docs/guide/advanced/composition.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ For more details of `t`, see the [API Reference](../../api/composition#t-key).

## Pluralization

In the Legacy API mode, the plural form of the message was translated using either `$tc` or the VueI18n instance of `tc` to translate the message.

In the Composition API mode, the plural form of the message is left in syntax as in the Legacy API mode, but is translated using the `t` of the Composer instance:

```vue
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/essentials/local.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[In *'Scope and Locale Changing’*](scope), Vue I18n has two scope concepts, global scope and local scope.

In general, locale info (e.g. `locale`,`messages`, etc) is set as option of `createI18n` and it sets (install) with `app.use`. To sum up, you use global scope translation functions `$t` and `$tc` to localize them.
In general, locale info (e.g. `locale`,`messages`, etc) is set as option of `createI18n` and it sets (install) with `app.use`. To sum up, you use global scope translation functions `$t` to localize them.

Sometimes it is necessary to localize per component while still managing the resources of the local messages. In this case it can be useful to localize each local scope using i18n component option on the component instead of the global scope.

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/essentials/pluralization.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ The `apple` has `no apples | one apple | {count} apples` pluralization message,

The number can be accessed within locale messages via predefined named arguments `{count}` and/or `{n}`. You can overwrite those predefined named arguments if necessary.

The following is an example of using `$tc`:
The following is an example of using `$t`:

```html
<p>{{ $t('apple', 10, { count: 10 }) }}</p>
Expand Down
1 change: 0 additions & 1 deletion packages/petite-vue-i18n/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export {
VueI18nOptions,
VueI18nResolveLocaleMessageTranslation,
VueI18nTranslation,
VueI18nTranslationChoice,
WarnHtmlInMessageLevel
} from '../../vue-i18n-core/src/legacy'
export { I18nPluginOptions } from '../../vue-i18n-core/src/plugin'
Expand Down
1 change: 0 additions & 1 deletion packages/petite-vue-i18n/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export {
VueI18nOptions,
VueI18nResolveLocaleMessageTranslation,
VueI18nTranslation,
VueI18nTranslationChoice,
WarnHtmlInMessageLevel
} from '../../vue-i18n-core/src/legacy'
export { I18nPluginOptions } from '../../vue-i18n-core/src/plugin'
Expand Down
Loading