Content Translator

Migration

Follow this guide to migrate from the v1 version of the plugin to the v2 version.

Migrating from v1 to v2

The Kirby Content Translator v2 is a major overhaul in terms of architecture and features. This guide will help you migrate your existing projects from the v1 version of the plugin to the v2 version.

Configuration
A comprehensive guide to all the available configuration options for the Content Translator section.

New Configuration Options

While the v1 version relied on parameters like syncableFields, translatableFields, translatableStructureFields, etc., the v2 version introduces a more streamlined approach to managing translatable content. The new version uses a single fieldTypes property to define the fields types that should be translated.

By default, the following field types are supported and enabled:

  • blocks
  • layout
  • list
  • object
  • structure
  • text
  • textarea
  • writer

If you want to limit the translation to specific field types, you can use the fieldTypes property.

To include or exclude specific fields, you can use the includeFields and excludeFields properties. Both are empty by default. Note that if at least one entry is defined in includeFields, only these fields will be translated. Respectively, if at least one entry is defined in excludeFields, all fields except these will be translated.

For example, if you want to translate your whole content, except the company field name, you can use the following configuration:

sections/content-translator.yml
type: content-translator
excludeFields:
  - description
  - summary

Removed Properties

The following section properties have been removed in the v2 version in favor of the new fieldTypes, includeFields, and excludeFields properties:

  • syncableFields
  • translatableFields
  • translatableStructureFields
  • translatableObjectFields
  • translatableBlocks

PHP API

Since the PHP API is new in the v2 version, there is no need to migrate any existing PHP code.