Ever wondered if if it’s possible to have multiple languages supported in your canvas app? It’s easier than you think. Here is a step-by-step guide on how to implement the Microsoft Translator Text API.
The Microsoft Translator Text API is a part of Azure’s offer called Cognitive Services. A subscription is required to use these, but you can ask for a 12 month free trial, if you provide your credit card. So make sure you first fetch an authentication key, you will need it when trying to add the translator service to your application. Here is how to get one.
First you add the Microsoft Translator as a datasource . You will see you already have 2 options by time of writing. However the second one is premium, I should advise this one since it has better support and more intuitive results.
You will be asked to provide the authentication key on the right-hand side. If you filled this in correctly and the datasource has been added successfully, you should be able to use it as follows:
MicrosoftTranslator.Translate is one of the functions provided, next to the detect language and the speech function. As you can see in the intellisense, you provide the string value which needs to be translated and as second argument you pass the desired language. In a production environment, this will typically be a variable bound to the value of a language picker.
As you see, it is very straightforward to have multiple languages supported in your canvas app. If you have any questions, feel free to reach out.