---
title: "Language Variables"
description: "Translate the language variables a language is missing into one secondary language or several, from Kirby's language view."
canonical_url: "https://kirby.tools/docs/content-translator/panel/language-variables"
---

# Language Variables

> Translate the language variables a language is missing into one secondary language or several, from Kirby's language view.

Open a language from Kirby's **Languages** view to see its [language variables](https://getkirby.com/docs/guide/languages/custom-language-variables). The **Translator** button in a language's view translates the variables that are still untranslated and saves them directly – into the language you're looking at, or from the default language into several secondary languages at once.

## Add the Button

Kirby's language view has no blueprint, so the button goes into the `panel.viewButtons.language` option:

```php [site/config/config.php]
return [
    'panel' => [
        'viewButtons' => [
            // Kirby's default buttons, plus `content-translator`
            'language' => ['open', 'content-translator', 'settings', 'delete']
        ]
    ]
];
```

The list replaces Kirby's defaults, so keep naming every button you want. The button appears in the view of every language, and its actions are disabled for a role without the `languages.update` permission.

The button reads the plugin's [global options](/docs/content-translator/configuration/global). A button entry with options overrides them for the language view, such as [`batch`](/docs/content-translator/configuration/local#batch) to hide the batch run:

```php [site/config/config.php]
return [
    'panel' => [
        'viewButtons' => [
            'language' => [
                'open',
                'content-translator' => ['batch' => false],
                'settings',
                'delete'
            ]
        ]
    ]
];
```

<warning>

Kirby saves language variables into the language definition file in `site/languages/`. A language file that builds its variables in PHP, such as by loading a YAML file, is rewritten as a plain array – as with every variable you edit in the Panel.

</warning>

## Translate One Language

In a secondary language's view, **Translate → DE** in the **Translator** dropdown opens a dialog that counts the variables to translate:

<panel-mock>
<panel-dialog :cancelButton="true" :fields="{"help":{"type":"info","text":"7 of 8 variables are missing in Deutsch or still identical to English. They will be translated and saved directly."},"strategyName":{"type":"toggles","label":"Translate with","labels":true,"grow":true,"options":[{"value":"deepl","text":"DeepL","icon":"translate"},{"value":"ai","text":"ChatGPT","icon":"content-translator-openai"}]}}" :submitButton="{"icon":"translate","theme":"positive","text":"Translate"}" :value="{"strategyName":"deepl"}" size="medium">



</panel-dialog>
</panel-mock>

The provider choice appears when [both are configured](/docs/content-translator/providers/ai-translation). **Translate** saves the translations directly, and the view shows them.

When every variable already has its own translation, a notification says **Every variable in Deutsch has its own translation** instead of opening the dialog.

## Translate Several Languages

In the default language's view, **EN → All Languages** in the **Translator** dropdown opens the batch dialog. Each selected language is saved on its own, so a language that fails leaves the others saved. The run ends in **Variables translated for the selected languages**, or in a dialog naming each language that needs attention – see [Translation Results](/docs/content-translator/panel/translation-results).

## What Gets Translated

A variable is translated when it is missing or empty in the language, or still identical to the default language's. A variable with its own translation stays as it is. Each value of a countable variable is translated. A variable without text to translate, such as a number, a URL, or a lone `{count}`, is left out. On Kirby 5.6 and later, a variable named like one of Kirby's own translation strings, such as `search` or `next`, is left out too, since Kirby refuses to save it from the Panel.

## Variable Placeholders and KirbyTags

Variable placeholders such as `{count}` or `{{ name }}`, which `tt()` and `tc()` fill in, come back as written. When a translation loses or changes one, the variable is not saved, and the notification names it: **1 of 7 variables was not translated: cart.items**. A KirbyTag in a variable is translated like one in a field: only the attributes named in [`kirbyTags`](/docs/content-translator/advanced/kirbytags).

---

Every page of this site as Markdown: <https://kirby.tools/sitemap.md>
