Developers · Pages and Layouts
Translations Introduction
Last updated 1 November 2026
Keep site text in one YAML file per language and look it up with the t filter.
Translations keep the text of your site out of your templates. Each language has one YAML file of keys and values, and the t filter looks a key up in the current language. Use them when your site serves more than one language, and to set your own date formats and system messages.
Where translation files live
Put one file per language in app/translations/, for example en.yml and de.yml. Module code keeps its own in modules/<name>/public/translations/ or private/translations/.
app/translations/en.yml
en:
app:
greeting: Welcome back
time:
formats:
short: "%-H:%M"Use a translation
<h1>{{ 'app.greeting' | t }}</h1>t is the main spelling; translate is another name for it. Date formats live under time.formats and are used by the l filter: see Date format.
Example: a missing key
insites-cli exec liquid docs57 "{{ 'app.missing.key' | t }}|{{ context.language }}"
translation missing: en.app.missing.key|enThis ran on the docs.insites.io instance on 1 November 2026. A key that is not defined prints a translation missing message rather than failing, so a typo shows up on the page. context.language holds the current language.
Common mistakes
- Forgetting the language key at the top of the file. Keys sit under
en:,de:and so on. - Leaving a key out of one language file. That language shows the missing message.
- Putting text that changes often in translations. They suit fixed labels; content that editors change belongs in the CMS.