# tc()

Translates a count

****

- Source: <https://github.com/getkirby/kirby/tree/5.5.3/config/helpers.php#L567>

****

```php
tc(string $key, int $count, string|null $locale = null, bool $formatNumber = true): mixed
```

## Parameters

| Name | Type | Default | Description |
| ---- | ---- | ---- | ---- |
| `$key` (required) | `string` | – | – |
| `$count` (required) | `int` | – | – |
| `$locale` | `string` or `null` | `null` | – |
| `$formatNumber` | `bool` | `true` | If set to `false`, the count is not formatted |

## Return type

`mixed`

## Examples

Given a translation with a placeholder. You can define the translation as an array for different counts.

```php
'translations' => [
    'en' => [
        'errors'  => ['There are no errors', 'There is { count } error.', 'There are { count } errors.'],
    ],
    // …
],
```

Replace placeholder with given number.

```php
echo tc('errors', 0);
// There are no errors.

echo tc('errors', 1);
// There is 1 error.

echo tc('errors', 5);
// There are 5 errors.
```