> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tolk.every-day.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Placeholders

> How Tolk prevents a translation from breaking a placeholder.

A broken placeholder is the translation error with the biggest consequences: a visible `:attribute` on the site, or a PHP error in WordPress because `sprintf()` is missing an argument. That is why Tolk checks placeholders strictly.

## Which placeholders Tolk knows

Per project, you set which types Tolk checks under **Settings** (*Instellingen*).

| Type | Examples |
| - | - |
| Laravel | `:attribute`, `:Attribute`, `:count`, and plurals with `{0}`, `[2,*]` and the pipe `\|` |
| printf (WordPress) | `%s`, `%d`, `%.2f`, `%1$s`, `%%` |
| JS and ICU | `{name}`, `{count}` |
| HTML | `<strong>`, `<a href="…">`, `<br>` |

Tolk does not treat times (`10:30`), URLs (`https://`) or `::` as Laravel placeholders.

## What Tolk checks

| Rule | Example of an error |
| - | - |
| Every placeholder from the source is in the translation | `Het veld is verplicht.` as the translation of `The :attribute field is required.` |
| No placeholders that are not in the source | `:attribuut`: the name was translated too |
| Number and type of printf placeholders match the source | `%s` in the source, `%d` in the translation |
| A different order only with positions | `%s … %d` becomes `%2$d … %1$s` |
| A lone percent sign in a printf text is `%%` | `50% korting` in a text that also contains `%d` |
| Every plural form has the same placeholders | `:count` is missing in the `other` form |
| HTML tags identical and balanced | `<strong>` without `</strong>` |

A different capitalization than in the source (`:attribute` where the source has `:Attribute`) is only a warning: it can be intentional. The singular form may leave out the number, as is common: `Eén item` as the singular of `%d items`.

## When Tolk checks

* **In the editor:** while you type. You can save, even halfway, but the error stays visible.
* **In an import:** the preview counts the translations with a placeholder error. They are imported anyway, so you can fix them in the editor.
* **After an AI translation:** Tolk protects placeholders before the text goes to the AI and checks them afterwards. If there is an error, it retries once.
* **In an export:** a translation with a placeholder error is never included. Tolk uses the fallback instead. That way a live site never breaks on a translation.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.