# tt()

Translate by key and then replace placeholders in the text

****

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

****

```php
tt(string $key, array|string|null $fallback = null, array|null $replace = null, string|null $locale = null): string
```

## Parameters

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

## Return type

`string`

## Examples

```php "/site/languages/en.php"
return [
  'code' => 'en',
  'default' => false,
  'direction' => 'ltr',
  'locale' => 'en_US',
  'name' => 'English',
  'translations' => [
    'alert' => 'Attention: { message }'
  ]
];
```

In your templates…

```php
<?= tt('alert', ['message' => 'Something is not right']) ?>
```