Global Configuration

Configure the Content Translator Panel view button or set global defaults for sections.

You can configure the Content Translator Panel view button or set global defaults for Content Translator sections in your config.php file.

Available Options

You can configure all section-level options globally to apply to the Panel view button and all sections. For individual sections, these options can be overridden in their respective blueprints.

See the section configuration page for detailed descriptions of each option:

  • label – Custom label for the section
  • importFrom – Control import direction
  • import – Enable/disable import functionality
  • batch – Enable/disable batch translation
  • title – Include title in translation
  • slug – Include slug in translation
  • confirm – Show confirmation dialogs
  • fieldTypes – Which field types to translate
  • includeFields – Specific fields to include
  • excludeFields – Specific fields to exclude
  • kirbyTags – KirbyTags translation configuration

Panel View Button

The same options as for the section can be used to configure the Content Translator Panel view button. The only difference is that the options have to be set in the config.php file.

Kirby Content Translator Panel view button

As a quick reminder, here is how to enable the Content Translator view button in your blueprints:

  • In Kirby 5, you can enable the Content Translator view buttons per blueprint. The following example shows how to reference the default buttons and add the content-translator dropdown button to the site, pages, and files views:
    buttons:
      - preview
      - content-translator # Re-order the button as needed
      - languages
    
  • In Kirby 4, Panel view buttons are not supported. But the feature has been backported 🎉. The content-translator button is always placed after the language dropdown and cannot be moved. If you want to disable the button, set the viewButton option to false:
    config.php
    return [
        'johannschopplich.content-translator' => [
            'viewButton' => false
        ]
    ]
    

Global Section Defaults

Rather than defining the configuration in each blueprint, you can define global defaults in your config file. This is useful when every page's content should be translated by the same fields, for example. Set the global defaults in your config.php file:

config.php
return [
    'johannschopplich.content-translator' => [
        'fieldTypes' => [
            'blocks',
            'text',
            'textarea'
        ],
        'kirbyTags' => [
            'link' => ['text', 'title'],
            'image' => ['alt', 'caption'],
            'file' => ['text', 'title']
        ],
        'title' => true,
        'slug' => true,
        'confirm' => false
    ]
]
Local blueprint configurations will always override global defaults.

Customizing Plugin Labels

If you prefer to overwrite the default translations of the plugin, you can do so by adding translations for your language in the languages directory of your Kirby installation.

See the plugin's translations.php for the full list of translation keys.

For example, to change the translation of the import button to Synchronize in English, append the following translations array to the languages/en.php file:

languages/en.php
return [
    'code' => 'en',
    'name' => 'English',
    // ... Other language configuration
    'translations' => [
        'johannschopplich.content-translator.import' => 'Synchronize'
    ]
];