View Button & Section Configuration

Per-blueprint controls for the view button and section – override defaults, scope translatable fields, customize labels.

Kirby Content Translator can be added to Panel views via a view button (recommended) or a section. Both approaches support the same configuration properties and can be used together.

View Button Configuration

The Content Translator view button can be added to any Panel view (site, page, file) alongside the default buttons like the languages dropdown. It provides a dropdown menu with translation actions.

Basic Setup

To add the content-translator button to a Panel view, set the buttons option in the corresponding blueprint:

buttons:
  - open
  - preview
  - content-translator
  - languages

Advanced Configuration

Configure the button behavior with props in your blueprints:

buttons:
  preview: true
  content-translator:
    title: true
    slug: true
    excludeFields:
      - description
  languages: true

Section Configuration

As an alternative to the view button, you can add a Content Translator section to your blueprint. The section displays translation controls directly within the page content area.

Basic Setup

Add the Content Translator section to any blueprint:

pages/default.yml
sections:
  contentTranslator:
    type: content-translator

The section provides the same functionality as the view button but is placed within the blueprint layout.

This is how the basic section will look in the default language:

Content Translator section in default language

When switching to secondary languages, the section buttons will change to Import and Translate:

Content Translator section in secondary language

Advanced Configuration

Configure the section behavior with props:

sections:
  contentTranslator:
    type: content-translator

Available Properties

When configured globally, these properties will apply to both view buttons and sections. Local configurations can override them.
Snippets below show only the property line. Wrap them in buttons.content-translator (view button) or sections.contentTranslator with type: content-translator (section) – see the scaffolds above.

label String

Custom label for the Content Translator view button or section. The default depends on the Panel language (e.g., "Content Translator" for English).

To change the label to "Translate":

label: Translate

importFrom String

Controls import direction. Set to all to allow importing from any language to any language, including overwriting the default language with content from secondary languages:

importFrom: all

The button text will indicate that importing from secondary languages is allowed:

Content Translator section with import all option
By default, only importing from the default language to secondary languages is allowed to prevent accidental overwrites of default-language content. Use importFrom: all with caution.

import Boolean

Enable or disable content importing functionality entirely.

To hide the import actions in the view button or section, set the import key to false:

import: false

batch Boolean

Enable or disable batch translation (translating to multiple languages at once).

This property is only available for the default language:

Content Translator section in default language
Unlike per-language translation, this translation process is not reversible in the Panel. Use it with caution, as it may take a while to translate all content.

If you want to disable batch translations for multiple languages at once, you can set the batch property to false. This will hide the batch mode translation button in the view button or section:

batch: false

title Boolean

Include the model title in import and translation operations. This is particularly useful for pages, where the title is often a key piece of content.

title: true
Title changes cannot be reverted in the content history, unlike field changes. Use with caution.

slug Boolean

Similar to the title property, the model slug can be included in import and translation operations. This is particularly useful for pages, where the slug is derived from the title. The slug will be generated from the translated title.

slug: true
The title property is ignored on file models, where the title is a regular content field and gets translated with the rest of the content. The slug property is ignored on file and site models, since file names remain language-agnostic by design.

confirm Boolean

Show confirmation dialogs before import or translation operations. This is enabled by default to prevent accidental overwrites of content.

If you want to skip this dialog, you can set the confirm key to false:

confirm: false

fieldTypes Array

This is one of the most important properties. Specify which field types to include in import and translation operations. By default, the plugin imports or translates all text-like fields: list, tags, text, textarea, writer, and markdown. These fields can be nested within blocks, layout, object, and structure fields.

Default field types:

For example, to include only text and textarea fields in the translation:

fieldTypes:
  - text
  - textarea
To translate text fields within blocks, you must include both blocks and text in the fieldTypes array.
When translate: false is set on a field, it will be ignored by the translation process, regardless of the fieldTypes configuration.

includeFields Array

Specify specific fields to include in import and translation operations (field names are case-insensitive). This is useful if you want to translate only specific fields, either nested or not. The fieldTypes property is still respected.

When using the includeFields property, all fields are filtered by their key. The key is case-insensitive, meaning that text and Text are treated as the same field.

For example, to include only company and author fields in the translation:

includeFields:
  - company
  - author

excludeFields Array

Specify fields to exclude from the import and translation process (field names are case-insensitive). This is useful if you want to exclude specific fields while still including all fields of certain types via fieldTypes.

For example, to exclude description and summary fields from translation:

excludeFields:
  - description
  - summary
Fields with translate: false in their blueprint definition are automatically excluded.

kirbyTags Object

Configure selective translation of KirbyTag types and its attributes (e.g., link text, image alt text). By default, all KirbyTags are excluded to preserve URLs, filenames, and technical attributes.

kirbyTags:
  link: [text, title]
  image: [alt, title, caption]
  file: [text, title]
  email: [text, title]
  video: [caption]

For the full per-tag attribute reference and translation behavior, see the KirbyTags Configuration guide.

systemPrompt String v3.10.0+

Override the AI translation system prompt for this specific section or view button. Takes precedence over the global ai.systemPrompt config option.

systemPrompt: >
  You are a medical translator.
  Preserve clinical terminology
  and abbreviations.
See the AI Translation docs for the full default prompt and usage details.

Configuration Precedence

Properties are applied in the following order (later values override earlier ones):

  1. Default values (built into the plugin)
  2. Global configuration (in config.php)
  3. View button & section props (in blueprints)
config.php
return [
    'johannschopplich.content-translator' => [
        'fieldTypes' => ['text', 'textarea'], // Applied globally
        'confirm' => true
    ]
];

Localization

Override the plugin's default Panel labels by adding translations to your Kirby installation's languages directory. Useful when "Synchronize" reads better than "Import" for your editors, or when your project uses a language the plugin doesn't ship translations for.

See the plugin's translations.php for the full list of translation keys.
languages/en.php
return [
    'code' => 'en',
    'name' => 'English',
    // ... Other language configuration
    'translations' => [
        'johannschopplich.content-translator.import' => 'Synchronize'
    ]
];