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. Select and link required content types for further localization.
In the case that the imported languages are not yet added into the Lokalise project, select 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 a confirmation message will appear with:
- The 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 to 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 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.
Let's add 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 (the "Hello Contentful" course in my case). 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 to Contentful button. The selected languages will be updated in your Contentful project. 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.