Introduction
Lokalise is a translation management service for agile teams.
MoEngage <> Lokalise
MoEngage and Lokalise integration makes use of MoEngage's Content APIs to fetch real-time translations for all your content through Lokalise allowing you to deliver high-quality, localised content in your campaigns. This automates translation and frees up your teams to focus on delivering brilliant customer experiences.
Integration
library_add_check |
Prerequisites
|
Create a new Lokalise project
If you dont have an existing lokalise project, you need to create a new one. To create a new translation project,
- Log in to Lokalise
- Select New Project.
- Enter project details-
- Name your project
- Choose a Base Language (the language you will translate from),
- Add one or more Target Languages
- Choose Software Localization project type.
- When you are ready, click Proceed.
The integration makes use of Lokalise <> AWS S3 integration to fetch localised campaign content.
In Lokalise, you will create a translation key for each of the Content API variables you define in MoEngage. When the translations are ready, you can generate one JSON file per language and publish it on the URLs that will serve your Content API.
Step 0: Create a new Lokalise project
You can skip this if you already have a lokalise project. If you dont have one, you will need to create a new one. To create a new translation project,
- Log in to Lokalise
- Select New Project.
- Enter project details-
- Name your project
- Choose a Base Language (the language you will translate from),
- Add one or more Target Languages
- Choose Software Localization project type.
- When you are ready, click Proceed.
Step 1: Define user attribute for user language
You need to have a user attribute that defines the language for that user. If it is not captured already, you need to create a new user attribute. You need to send it to MoEngage as a user_language - custom tracked user attribute/property.
You can save this data to MoEngage either using:
- User Data API OR
- Upload them using User Imports inside MoEngage.
Important
Language code must match across both MoEngage and Lokalise.
Step 2: Prepare translations on Lokalise
You’ll need to manually create the translation keys with the same name you’re using in MoEngage Content API variables.
For example, let’s create a simple translation key, description:
- Open your Lokalise project, click Add Key
- Enter “description” in the Key field.
- Type “Demo description” in the Base Language Value field.
- Add “Web” in the Platforms dropdown.
- When you are ready, click Save.
Your translation key should appear in the project editor.
Warning! Known issues
- Your keys must be assigned to the Web platform.
- Avoid using keys that contain periods (.) or the _on string. For instance, use this_is_the_key instead of this.is.the.key, and use join_us_instagram instead of join_us_on_instagram.
Step 4: Setup Content API on MoEngage
- Navigate to Settings -> Advanced Settings -> Content API
-
Click + Add content API at the top right corner of the Content API screen.
- Add your Lokalise S3 URL
Copy paste the URL from the previous step. Change the {{${language}}} to the user attribute containing language of the user. Something like {{UserAttribute['language']}}. The final URL will look like this.https://exports.live.lokalise.cloud/moengage/56922681670e946661c118.58194959/ee13d3b5e92a0b11101efbfd11dddd8206560fe3/{{${language}}}.json
- Click Save.
Note - You can also test your APIs by clicking on the Test button. You can test your API response and validate
Step 5 - Use content APIs in MoEngage campaigns
You can now use these content APIs in your campaigns. Read here to know more about Content APIs.
- On step 2 on your campaign creation, enter @.
- In the pop up, you can select the Content API configured in Step 2.
- You can use MoEngage Templating Language to parse through the API response and use the content in your campaigns.