Contentful Native

Translate Contentful data in Lokalise. Supports linked entries and all rich text capabilities.

Alex Terehov avatar
Written by Alex Terehov
Updated over a week ago

This feature is available starting from the Pro plan and above. Also available for purchase on other paid plans.

This is an app that runs in the Contentful Editor. If you're looking for a current app that works from Lokalise, please refer to the corresponding article.

Main capabilities of the native app:

  • Import and export content between Contentful and Lokalise.

  • Works with all RichText capabilities.

  • Works with pages that contain multiple layers of referenced entries.

  • Could be separately installed in different spaces and any environments.

Installation

Installing the app

To install the app, open Contentful, navigate to Apps, select Marketplace, choose Translation and Localization category, find Lokalise, and then press Install:

Next, select an environment where you want to install the app. Lokalise app could work with any environment and the app could only be installed to one environment:

If you can't connect to Lokalise, check browser notifications as some browsers may block the authorization popup.

Select content types that should contain a Lokalise app in the sidebar inside Contentful entry Editor or Compose app and click Install in the top right corner:

Review the default settings and click Save in the top right corner:

Exporting entries from Contentful to Lokalise

The Lokalise section will appear in the sidebar for Entries of content types that you have selected during installation (if it's not there, please refer to the section below)

Click Export content to Lokalise to export the default locale value:

Translating exported entries on Lokalise

Now proceed to your Lokalise project and open editor. You'll see that the corresponding Lokalise tags have been linked to the inserted keys:

The following tags are added automatically:

  • contentful-native — refers to the app itself

  • [Page] ... — the title of the entry that has been initially exported to Lokalise.

The key names are generated using Entry ID and Field ID separated with the : delimiter.

Sort keys by First added to see fields appear in the same order as they appear within the Contentful editor.

Importing translations from Lokalise to Contentful

Translations can be imported from the Lokalise sidebar section. You can import one or multiple locales:

You'll see a dialogue with a preview of translations to be imported. Click Import from Lokalise to update translations in Contentful:

How composable pages with referenced entries are exported

The Lokalise app exports the entry where export has been run initially along with all the referenced entries from this page, whether they were references in separate fields or from RichText content.

You can preview what entries will be exported in the export dialog:

Unchecking a referenced entry means that all entries below won't be exported.

All selections are saved per content type, so once you have configured an export you won't need to re-configure it in subsequent exports for the same content types.

Lokalise app follows all linked entries except entries that are separate pages. The app considers an entry a separate page if this page has a field with slug ID:

Fields from the referenced entries would be exported into separate keys and the key name would contain the ID of the referenced entry. A connection between exported and referenced entries is maintained via tags -- referenced entries would have a tag with the title of the exported entry.

Fields that can't be exported to Lokalise

Not all fields can be exported to Lokalise. Such fields will be marked with greyed-out checkboxes and you'll see tooltips with explanations. For example, check the ISBN field in the screenshot below:

Here are the main reasons why fields or entries might not be exported to Lokalise:

  • A field doesn't have localization enabled. Non-localized fields cannot be imported to Lokalise as Contentful won't accept translations for such fields. Please refer to the section below to learn how to enable localization for a field.

  • A field doesn't have a text-based field type. Only the following field types are exported to Lokalise:

    • Symbol — short text

    • Text ⁠— long text field

    • RichText — formatted text

  • An entry is archived. Translations for archived entries cannot be updated.

Enabling localization for a field

To enable localization for a field, navigate to the Content model tab, click on the name of the desired item, and then click Edit for a field you want to configure:

Then check the Enable localization of this field setting:

Don't forget to save the changes.

Adding plugin to the sidebar

If you are working with custom types and want to connect those to Lokalise, you'll need to perform some additional actions. You can also find more information in the Contentful docs.

First, navigate to the content model:

Click on your content type and proceed to Sidebar:

Add the Lokalise plugin:

Don't forget to save the changes.

Known limitations

  • Exporting and importing can be performed only on Contentful (not on Lokalise).

  • Cross-space references are not supported.

  • Automated export and import are not supported.

  • Only field-based localization is supported.

  • Images and other assets, and their fields cannot be localized via Lokalise.

  • Fields containing Markdown markup will be imported as plain text, without creating Lokalise placeholders.

  • Lokalise automations are always enabled when exporting from Contentful to Lokalise via the native app.

Did this answer your question?