Working with translations

In today's increasingly globalized world, foreign markets are becoming more and more important. As you create content for these markets, you may end up needing to translate it into multiple languages. This process of translating and adapting is called localization, while specific regions are known as locales.

This article provides an overview of working with locales after they've already been set up for a space. You'll need help from your development team to get them enabled for your project. For a more detailed guide on locales and how to set them up, see our developer documentation.

Working with locales

Note: You need to have administrator permissions to add locales to a space. 

Generally speaking, locales are language-region pairs. They are used for sharing content with a global audience. In this example, our entry has the locales en-US and de-DE, which means it's available in English (United States) and German (Germany).

Adding locales to a space

First, make sure locales have been set up for your organization. (Talk with your developer team if you’re not sure, and have them take a look at our guide if they need help.)

Once locales have been set up, adding them to a space is straightforward:

new-locale

The New locale page in Contentful

  1. In the web app, click the Settings tab in the navigation bar. Select Locales from the drop-down menu. 

  2. You will be brought to the Locales area. Here is where you can find a list of all locales that have been added to your space. To add a new locale, click the blue Add locale button in the right-hand sidebar. 

  3. Select the locale you’d like to add from the drop-down menu. Make sure you pay attention to the language-region keys!

  4. If desired, select a fallback language to be displayed if a translation in the selected locale is not available. 

  5. If you have required fields in your content type, make sure to check the box for Allow empty fields, or else your editors will be unable to publish content without adding a translation for the required field.

  6. When satisfied, click the green Save button. Your locale will be added to your space. 

For a more in-depth guide to locales and setting them up, see our locale concept documentation.

Editing or deleting locales

deleting-a-locale

Deleting a locale in Contentful

To edit an existing locale:

  1. In the web app, click the Settings tab in the navigation bar. Select Locales from the drop-down menu. 

  2. You will be brought to the Locales area. Click the name of the locale you’d like to edit. 

  3. Edit the fields or locale options you’d like, and click the green Save button when finished. 

To delete an existing locale:

Note: You cannot delete the default locale for a space.

  1. In the web app, click the Settings tab in the navigation bar. Select Locales from the drop-down menu. 

  2. You will be brought to the Locales area. Click the name of the locale you’d like to delete.

  3. Click the red Delete button. The delete locale dialog will open. Make sure you’re deleting the correct locale!

  4. When certain, type in the code for the locale to confirm, and click the red Delete button. To cancel, click the grey Don’t Delete  button.

Enabling locales for fields and entries

localizing-field

Settings for a field, where localization is enabled

Once locales are added to your space, the next step is to enable them for fields and entries. 

To enable locales for fields and entries:

  1. In the web app, click the Content Model tab in the navigation bar. 

  2. Select a content type from the list. In the editor, click the Settings link for the field you want to enable locales for. 

  3. In the ensuing dialog, check the "Enable localization of this field" box under Field options. 

  4. Click the green Save button to finish. 

  5. Now all entries of that content type can be edited for the locales you added to your space.

Adding and editing translations

Once locales have been set up and enabled, adding translations is done with the entry editor. 

working-with-locales

Selecting multiple locales to view for an entry

To add translations for an entry:

  1. From the master content list, select the entry you want to translate. The entry editor will open. 

  2. In the sidebar, under Translations, is a list of all language locales that the entry can be translated into. By default, the single locale option is enabled.

  • To view multiple locales for an entry, use the multiple locales option in the drop-down menu. You can choose which locales to see by clicking the Change link and selecting your desired locales from the list.

  • To view one locale at a time, use the single locale option in the drop-down  menu. This lets you see only the fields for the language locale you select, and hides the fields for the other language locales.

3. From here, the process is exactly the same as adding entries. Click the Publish button when you’re finished.

Localizing assets

You can have multi-language versions of your media assets, just like you can for entries. Adding translations for assets is done in the media editor. 

To localize an asset:

  1. Click the Media tab in the top navigation bar.

  2. Select the file you want to translate from the list. The media editor opens. 

  3. In the sidebar, under Translations, is a list of all language locales that the asset can be translated into. 

translation-drop-down-multiple

  • To view multiple locales for an entry, use the multiple locales option in the drop-down menu. You can choose which locales to see by clicking the Change link and selecting your desired locales from the list.

  • To view one locale at a time, use the single locale option in the drop-down  menu. This lets you see only the assets for the language locale you select, and hides the assets for the other language locales.

translation-drop-down

4. From here, the process is exactly the same as adding assets. Click the Publish button when you’re finished uploading your files.

For a more in depth explanation of working with locales, see the following four minute video

Was this helpful?
add-circle arrow-right remove style-two-pin-marker subtract-circle remove