Connect your Hygraph project to Lokalise
Lokalise is a localization management platform where teams can easily build and manage workflows for multiple locales and translations of existing content. It enables teams to build collaborative workflows around localization, ensure high quality translations are pushed live, and create new locales for a wide range of digital products, from applications to websites.
#What you can do with the Hygraph-Lokalise integration
- With the Hygraph-Lokalise integration, teams can simplify their workflows between Lokalise and Hygraph by creating bulk imports and exports of content and easily manage multiple locales for their digital products through a dedicated interface within Hygraph.
#Prerequisites to use this integration
- You must have a Hygraph account. If you don't have one, you can create one here.
- You must have a Hygraph project.
- You must have a Lokalise account. If you don't have one, you can create one here.
- You must have a Lokalise project. The project type must be Software localization, and you must select a base language for your project in your project settings.
- You must create a Lokalise API Token.
Apps are environment specific. This means their configuration is applied per environment. Take this into consideration if you're working with a project using more than one environment.
#Install the Lokalise app
Click here to install the Lokalise App on Hygraph, then follow these steps:
- In the dropdown, select which project you want to install the app in, then click on the
Add Appbutton. You should be redirected to your Hygraph project dashboard.
- Fill in the
API tokenand the
Project ID. This information can be found in your Lokalise account. The Hygraph UI provides links that show you how to get the information you need next to each requested field.
- Select at least one model to use Lokalise in. This information can be edited later by going to the Apps section of your Hygraph project, then clicking on the pencil icon in the Lokalise card to edit the details.
- Click on the
#Use Lokalise in your Hygraph project
As you create content, it will display in the Lokalise section of the Content editor, under App views. From there, you will be able to export content to Lokalise to be translated, then import those translations into Hygraph.
Please note that only the content created using the Model that you selected during the Lokalise installation process will be displayed on this list.
You can edit this from your Hygraph project by navigating to Apps > Lokalise, clicking on the pencil icon to edit, then using the checkboxes to select the desired models.
Finally, after the process has been completed, you will be able to view the translated content normally by accessing the Content editor.
Take into account that only localizable fields can be submitted to Lokalise. So the fields must be set as localized fields when added to the model.
Localized field checkbox
You will find the
Localized field checkbox at the bottom of the field details screen, which displays when you create or edit a field in the Schema editor.
Submit to translate
- Navigate to the content editor.
- Select Lokalise under the App views section of the right sidebar.
- Use the checkboxes to select the desired content from the list, and send it to Lokalise by clicking on the
Submit to Translatelink at the top of the form.
- A pop-up will display, where you need to select the locales to export. Select the necessary checkboxes, and click on the
- The translation status will change to In progress, and you will be able to find the content ready to translate in your Lokalise account.
If the content is exported successfully, a green message will pop up in the lower right corner of the screen indicating this. If it fails, a red message will be displayed in the same place indicating that the submit was unsuccessful.
The following fields are supported to be exported to Lokalise:
- Single-line text
- Multi-line text
Export is also supported for Basic and Modular Components, but only for the supported field types.
You can copy the entry ID and use it on Lokalise to filter the entry there and easily find it.
- Navigate to the Lokalise section of the Content editor. Use the checkboxes to select the entries that you want to import translations for, then click on the
Import Translationlink at the top of the form.
- A pop-up will display, where you need to select the language or languages of the content being imported. Select the necessary checkboxes, and click on the
Import translationbutton. The translation status will change to
Importedas a result.
The following fields are supported to be imported from Lokalise:
- Single-line text
- Multi-line text
Import is also supported for Basic and Modular Components, but only for the supported field types.
Please note that the status Done means that all translations on Lokalise have been finished and that the content is ready to be imported.
The Lokalise app view of the Content editor contains a form that allows you to view the localization status of your content as well as to export and import translations in bulk.
Lokalise secton in App view
Your Locale status refers to the default language in your project. The language will be indicated next to the column title, i.e.
Locale status (en).
Your Global status refers to all the languages that were submitted for translation.
|Indicates that an entry has never been sent to Lokalise.
|Indicates that an entry has been submitted for translation.
|Indicates that all translations have been finished in Lokalise, marked as reviewed, and imported.
|Indicates that an entry has been edited after it was sent to Lokalise.
|Indicates that one or more translations - but not all - have been finished in Lokalise, and imported to Hygraph.
- Navigate to the content editor, and select the view of the model you included Lokalise in.
- Edit an entry that you imported a translation for by clicking on the pencil icon. The content will display at the center of the screen.
- You will find the
Localizationssection in the right sidebar. You have the following options:
- Click on the
+icon to add a translation.
- Click on the trash icon to delete a translation.
- Click on the eye icon to view a translation in the editor.
- Click on the
If the Content Editor displays the message
This model has no localized fields under localizations in the sidebar, while the Schema Editor has localizations configured, go to Project settings > Locales. There, make sure your project has at least two languages configured.
Locales in project settings
If you have only one language configured there, select another language for localizations using the
Display name dropdown, then click on
Please note that free plans can have a maximum of 2 locales.