As an Editor, you might need to create content in different languages. Localization is supported as a core feature in Hygraph. A locale is a language you add for the content to be translated into. You will see them as spaces in your content entry where you can add a translation.
While as an Editor you don't have to configure any settings for localization, it's important to know that the languages available for you to use in the content editor depend on the project configuration. These locales can be both default and custom.
When configuring the schema, a field can be set as
Localized field. This means each field can have an assigned localization which is part of field configuration, and not a duplication of that content. This basically means that you can work on localized content entries with "per field" granularity.
#Add a localization
- Navigate to the content editor tab.
- Select the model where you want to create a content entry.
- Click on
+ Add entryin the upper right corner of the screen.
- Work on your entry.
- Select the locale you want to add by clicking on the
+icon next to the language you want to translate into, in the localization section of the content entry sidebar. This displays the localized fields for entries according to model configuration. The first two letters of the language of the localized field display above it for easy identification.
- Enter the localized text in the fields you want and complete the rest of your entry according to your task.
- Save or Save & Publish.
#Show / hide a locale
To work with localizations, look for the purple eye icon in the localization section of the content entry sidebar. If it appears gray, that means the locale is not selected. Click the gray icon to select it.
Selecting and deselecting locales controls their visibility on the screen. If a locale already has content saved in it, selecting or deselecting it will not affect the content, only its visibility.