# t()

Returns translate string for key from translation file

****

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

****

```php
t(array|string $key, array|string|null $fallback = null, string|null $locale = null): Closure|array|string|null
```

## Parameters

| Name | Type | Default | Description |
| ---- | ---- | ---- | ---- |
| `$key` (required) | `array` or `string` | – | – |
| `$fallback` | `array`, `string` or `null` | `null` | – |
| `$locale` | `string` or `null` | `null` | – |

## Return types

`Closure`, `array`, `string` or `null`

## Examples

The `t()` helper returns a predefined translation string by key.

Translations can be defined <a href="https://getkirby.com/docs/guide/languages/custom-language-variables">in the language files</a> or <a href="https://getkirby.com/docs/reference/plugins/extensions/translations">in plugins</a>.

Get a translation string by key:

```php
<?= t('confirm') ?>
```

Use a fallback value if no translation exists:

```php
<?= t('confirm', 'Confirm') ?>
```

Force a particular locale:

```php
<?= t('confirm', 'Bestätigen', 'de') ?>
```