The Crowdin integration allows your Certainly chatbot to seamlessly request and print Crowdin translations into your conversations. In this article, we will explore how to do the following:
In order for us to make API requests to translate, we need four elements:
You can also read Crowdin's documentation regarding Crowdin API v2.
To create a new token, please follow these simple steps:
- On Crowdin's website, navigate to the profile menu on the top right corner and click on "Settings".
- Navigate to the API Tab, then click on "New Token".
- Make sure you copy and save that token since it will only be shown once.
Navigate to your project menu on the top left-hand side and select the desired project. Information from that project will be displayed on the right.
Assuming your project has at least one translation, we need to make sure that we use the right language code on the API request. Remember to use the correct one for the specific target language you used on your project (e.g., es-ES = Spanish).
In order to simply retrieve the string IDs of your source file, we are going to make a request using the Crowdin - Get Sentence List Template Webhook and follow these 3 steps:
- First, add the API token (remember to include Bearer and a space before the token).
- Next, add the Project ID number.
- If you run the Webhook and everything is correct, you will have a response mapped below called "table" that displays only the String ID and the sentence in the source language.
You can also find the string IDs linked to the specific sentences either from the file you uploaded yourself or from the translation platform on Crowdin's website.
In order for the Webhooks to trigger a successful response, the previously explained steps need to be correct. Once we've gathered all the information needed, we can create a new Webhook.
To do so, access the Section menu in the Navigation bar, select "Webhook Builder", then choose "Create from Template". In the marketplace that opens, you will find the already created Crowdin - Get Translation Webhook Template.
Inside, you will have to enter the required authentication (again, remember to add Bearer and a space before the token) and parameters for it to work. They are explained below:
- languageId : Language code of target language (could be a fixed value if there's only 1 target language, e.g., "es-ES", or a variable such as "" in the case that multiple translations are needed)
- stringId : String ID of the sentence to be translated
- projectId : Project ID of the source translation (can be a variable if working with multiple projects)
After setting up the values/variables, you will find that there's a Custom Variable mapped named "translation". This Custom Variable will be used as a bot reply to display the translated response from the Webhook.
Here you'll find an example of a small integration that includes multiple languages. For successful integration, we suggest following the steps below.
- First, set up the flow:
- After selecting the desired language in the "Connections" tab, fill in the necessary values and add the Crowdin - Get Translation Webhook. Remember to add the Go To / Fallback for that Module's desired translation.
- Navigate to that Module's "Message" tab. In the message bubble, add the Custom Variable [[translation]] (must be between the double brackets) in order for it to be printed during runtime.
- Repeat the process of updating the values of the desired stringId, WH execution, and Module. In the example, there's no response needed after the <md>Welcome Module, which is why it skips ahead without a human reply.
If you're able to replicate the functionality, you've succeeded at integrating Crowdin translations into your bot replies! Should you encounter any problems in the configuration, please contact our Customer Success team.