Skip to main content

Sync Contentstack data with Lokalise.

Ilya Krukowski avatar
Written by Ilya Krukowski
Updated over a week ago

This feature is available from the Pro plan and above.

Use this app to sync your Contentstack data with Lokalise in just a couple of clicks.

Setting up

Adding Contentstack languages

First, you should decide which languages you would like to translate into. Therefore, proceed to Contentstack, open your stack, and click Settings > Languages:

Click New language. You'll see the following dialog box:

Here you can either choose one of the predefined languages, or create a custom one. Once you are ready, click Add.

Configuring Contentstack app

Now let's integrate Lokalise with Contentstack. To achieve that:

  • Open your Lokalise project.

  • Choose Apps in the top menu.

  • Find Contentstack in the apps list and click on it.

  • Click Install. You'll be presented with the following dialog box:

To generate a new API key and a management token, return to Contentstack, and click Settings > Tokens. Switch to the Management tokens tab and click +Management Token:

You'll see the following screen:

You must provide a name and choose read and write permissions.

Click Generate token and you'll be presented with your API key and a token:

Simply copy these values and paste them into the corresponding text inputs on Lokalise. Please note that these values must never be publicly exposed!

Once you are ready, return to Lokalise and click Authorize. You'll be presented with a empty content list:

Simply click Refresh list to fetch data from Contentstack and reload the page. If you ever need to fetch newly created content from Contentstack again, simply click the Refresh button.

Importing data from Contentstack to Lokalise

Now that we have everything set up, it's time to choose what content to import from Contentstack to Lokalise. To achieve that, simply tick the checkboxes next to the items you wish to import, and then click Import selected:

You can also narrow the scope by creating a custom filter or by using a search box at the top.

After clicking Import selected, you'll be presented with the following dialog box:

  • Import languages — choose which languages you'd like to import from Contentstack (please check Adding Contentstack languages to learn how to manage these languages). If your Lokalise project does not contain the chosen languages, these will be created automatically.

  • Overwrite updated translations — tick this option if you would like to update already imported data on Lokalise with new content from Contentstack.

  • Skip key creation for empty translations — when enabled, Lokalise will not create translation keys for empty items.

  • Assign tags — choose which tags you'd like to assign to the imported items.

Once you are ready, click OK. The import task will be performed in the background, and you'll see a small notification message once it completes. Then you can proceed to the project editor and perform translations as usual:

Exporting data from Lokalise to Contentstack

Once you have finished translating your content, it's time to export it back to Contentstack. To achieve that, open your Lokalise project, proceed to Apps > Contentstack and tick the items you wish to export. Then simply click Export selected:

You'll see the following dialog box:

  • Export languages — choose languages that you would like to export translations for. Please note that you will be able to choose only the languages that were added on Contentstack as explained above.

  • Don't export empty translations — when enabled, Lokalise will ignore all empty translations and these won't be exported to Contentstack.

Once you are ready, click OK. The export operation will be performed in the background, and you'll see a small notification message once it completes.

Known issues

Unique IDs

When you first define a content type in Contentstack, each field is assigned a unique ID based on its display name. Should you later decide to customize this ID, it's crucial to note that the Contentstack Lokalise app will then generate a new key name. This aspect is vital as the integration's functionality hinges on consistent key names. However, altering the display name will not affect the linkage to an existing Lokalise key.

Modifying a field's unique ID in Contentstack will result in the following actions:

  • For Contentstack:

    • The content within the field (for all entries derived from this content type) will be removed.

  • For the Lokalise App:

    • Upon pressing the Refresh button, previously existing entries will be removed from the list and replaced with new ones.

    • During import, Lokalise will generate new keys bearing different names.

    • Upon export, these new keys will be utilized instead of the original ones.

    • The original keys will no longer be associated with the Lokalise app.

Did this answer your question?