This integration is available from the Pro plan and above.
Use this integration to sync your Contentful data with Lokalise. It's a good idea to use a separate Lokalise project for Contentful data localization. Lokalise can only sync Text, Symbols and RichText.
To set up the integration for your project:
- Navigate to the Project settings > Integrations.
- Click Connect at the required integration.
- Authorize via OAuth2.
Once you authorize, the list of spaces and relevant content types will appear.
You can find a specific element by using the search box at the top right corner, or use the Filter dropdown to narrow the scope.
Select and download the required content types for further localization by clicking Import selected.
All missing languages will be added to your Lokalise project automatically. By clicking the Import selected button, the chosen items will be connected to translation keys in your project. This process will be performed in the background, and you can check its status on the Activity page:
Please note that if you have already connected certain elements to the translation keys, and would like to update contents for these keys, you have to tick the Overwrite updated translations checkbox before importing:
Performing translations and managing locales
Let's check how the inserted keys look in Lokalise. I have added a sample Contentful course from the The example project, so the appropriate tags have been linked to the inserted keys:
Once the necessary data is imported, you can add the required languages and perform translations.
Please note, target languages must be added in your Contentful project as well. You can do this under the Locales settings by clicking the Add locale button.
Once a language is added in the Contentful settings, you have to connect this language to your data. You have to be sure that an added language has the same ISO codes in both Lokalise and Contentful, so they can be successfully synchronized.
Once the translations are done, select the items you want to export to Contentful and click the Export selected button.
Choose the languages to export and decide whether you'd like to upload empty translations:
The selected languages will be updated in your Contentful project. This process will also happen in the background.
In the case that any changes were made in your Contentful project, you can update the existing Lokalise keys by importing items from Contentful.
Not all entries and their fields can be linked to keys, due to the lack of localization field or invalid types.
If all entry fields are invalid, the whole item is marked as not eligible for linking.
Valid item prerequisites:
- Entry must not be archived — archived entries cannot be updated upon export
- Entry field must be localized — non-localized fields can't be imported to Lokalise
- Valid entry field types:Text — long text fieldSymbol - short textRichText - formatted text
Lokalise integration currently does not support the following elements in rich text content:
- Hyperlinks (coming soon)
- Entry links
- Embedded entries
- Inline entries
The Lokalise integration works by rendering a proprietary document to HTML for modifications and parsing it back to RichText document for export.
Some objects can be configured as "localized": false, so Contentful assumes that these are not supposed to be localized and these items will not be linked. You need to adjust that parameter in your Contentful content model.