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. Log in to the Contentful web app.

  2. Сlick Settings and select Locales from the drop-down menu. The Locales page is displayed.

    Locales open from settings
  3. In the Locales page, click Add locale in the right-hand sidebar. 

    Locale add locale

  4. In the Select a locale field, select the required locale from the drop-down menu. NOTE: Make sure you pay attention to the language-region keys!

  5. Optional: Select a fallback language to be displayed if a translation in the selected locale is not available. 

  6. Optional: If you have required fields in your content type, select the Allow empty fields checkbox, or else your editors will be unable to publish content without adding a translation for the required field.

    Locale set up locale

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

    Locale save locale

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

Editing locale

To edit an existing locale:

  1. Log in to the Contentful web app.

  2. Сlick Settings and select Locales from the drop-down menu. The Locales page is displayed.

    Locales open from settings

  3. Go to the required locale and click to open it.

    Locale open specific locale

  4. Edit the fields or locale options you’d like, and click Save to apply the changes.

    Locale save locale

Delete a locale

To delete an existing locale:

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

  1. Log in to the Contentful web app.

  2. Сlick Settings and select Locales from the drop-down menu. The Locales page is displayed.

    Locales open from settings
  3. Go to the required locale and click to open it.

    Locale open specific locale
  4. Click Delete. The delete locale dialog is displayed. NOTE: Ensure you’re deleting the correct locale.

    Locale delete a locale
  5. Enter the code for the locale to confirm, and click Delete. NOTE: To cancel, click the grey Don’t Delete  button.

    Locale confirm delete locale

Enabling locales for fields and entries

Locale  enable field localization

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. Log in to the Contentful web app.

  2. Go to the Content model tab.

  3. Go to the required content type and click to open it. The content type editor is displayed.

  4. Go to the required field and click Settings.

  5. Under the "Settings" tab, select the Enable localization of this field checkbox under the "Field options" area. 

  6. Click Confirm to save changes.

  7. Click Save to apply changes to the content type. All entries of your content type can be edited for the locales that are 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. Log in to the Contentful web app.

  2. Go to the Content tab.

  3. Go to the required entry and click to open it. The entry editor is displayed.

  4. In the sidebar, scroll to the TRANSLATION area to view the list of all language locales for your entry. By default, the single locale option is enabled.

  5. Select your locale viewing mode according to the following options:

    • View multiple locales simultaneously — Select Multiple locales option from the drop-down menu. Add more locales for viewing by clicking Change and selecting checkboxes against your desired locales.

    • View one locale at a time — Select Single locale option from the drop-down menu. The fields for only one locale are displayed, while the fields for the other language locales are hidden. You can switch between the locales using the locales drop-down.

  6. Add content to the fields of the newly added locales as described in adding entries. Click Publish 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. Log in to the Contentful web app.

  2. Go to the Media tab.

  3. Go to the required asset and click to open it. The asset editor is displayed.

  4. In the sidebar, scroll to the TRANSLATION area to view the list of all language locales for your asset.

  5. Select your locale viewing mode according to the following options:

    • View multiple locales simultaneously — Select Multiple locales option from the drop-down menu. Add more locales for viewing by clicking Change and selecting checkboxes against your desired locales.

    • View one locale at a time — Select Single locale option from the drop-down menu. The fields for only one locale are displayed, while the fields for the other language locales are hidden. You can switch between the locales using the locales drop-down.

  6. Add media and related content to the fields of the newly added locales as described in adding assets. Click Publish when you’re finished uploading your files.

Additional resources

For a more in-depth explanation of working with locales, see the following video:

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