This integration is available starting from the Pro plan.
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. Select and link required content types for further localization.
In case the imported languages are not added into the Lokalise project yet, tick the Create missing languages checkbox. Missing languages will be automatically added into your Lokalise project.
By clicking the Link items button, the selected items will be linked and the confirmation message will appear:
- A number of linked items
- How many keys were created in the Lokalise project
- Which languages have been added and how many keys were updated in a particular language
Linked items can be manually imported/exported from Contentful into Lokalise and vice versa.
You can sort linked items using the Space and Content type dropdown menus. If required, you can link more items or unlink the existing ones.
Let's check how the inserted keys look in Lokalise. Three keys were created: Title, Short Description and Description.
I have added the "Hello Contentful" course from the The example project, so the appropriate tags have been linked to the inserted keys. Learn more about tags...
Once the necessary data is imported, you can add required languages and perform translations.
Note, target languages must be added into your Contentful project as well. You can do it under the Locales settings by clicking the Add locale button.
Let's add the Russian, translate our data and export it back to the Contentful project.
Once a language is added in the Contentful settings, you have to link this language to your data ("Hello Contentful" course in my case). You have to be sure that an added language has the same ISO codes in both systems, in Lokalise and Contentful, so they could be synchronized.
Once the translations are done, select the items that you want to export into Contentful and click the Export to Contentful button. Selected languages will be updated in your Contentful project. In case any changes were done 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 on export
- Entry field must be localized — non-localized fields can't be imported in Lokalise
- Valid entry field types:Text — long text fieldSymbol - short textRichText - formatted text
The 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.