PubNub Integration

Microsoft Azure | Translator

In-app chat

In-app chat

Chat & Social

Chat & Social

Bots & AI

Bots & AI

Last Updated:

2018/04/11

Author:

Stephen Blum

APISign-upDocumentation

Translate text in 60+ languages for more natural chat conversations between users

Microsoft Translator, a Cognitive Services offering from Microsoft Cloud and Enterprise division, provides a scalable, compliant, and customizable neural machine translation cloud service. Supporting over 60 languages, Translator can be used to build applications, websites, tools, or any solution requiring multi-language support. Built for business, Microsoft Translator technology powers translation features across Microsoft products, including Microsoft Translator apps, Office, Edge, SharePoint, Yammer, Visual Studio, Bing, and Skype. By simply integrating translation into web, desktop, or mobile applications, using industry standard REST technology, the Translator API provides a rich functionality set for any developer.

Microsoft Translator Text API

Leverage the latest in modern neural machine translation technology to translate between languages. Whether a chat application or support desk agent ticket system, you'll have translation power of the new Microsoft Translator API. This function is compatible with ChatEngine, an open and extensible chat SDK and APIs for building powerful 1:1 and group chats quickly.

Source JSON Message

Your original source message will contain two important strings: "text" and "language". Inside the "text" string include your message to be translated. Next you will specify your target translation languages. You can specify more than one language! When specifying the "language" string, you may delimit the language codes with a ',' comma. Try a target languages like "zh" for Mandarin. And target the language to be both Mandarin and Spanish "zh,es".

{
    "text"     : "Hello",
    "language" : "zh,es"
}

Translated JSON Message

Note that your original "text" string is left intact. You'll see a new "data" object in your JSON message with your requested target translations inside! There is a bonus object too. The "detectedLanguage" object contains the estimated source language you provided. A "score" integer is included based on the estimated accuracy. A score of "score": 1 is a good score. Your translations will be inside the "translations" array. Each element of this array contains each of the translations you requested in your target "language" string. You are able to change any part of the response objects format. Click "Try it now" to install this function in your PubNub dashboard.

{
    "text" : "Hello",
    "language" : "zh,es",
    "data" : {
        "translation": {
            "detectedLanguage": {
                "language": "en",
                "score": 1
            },
            "translations": [
                {
                    "text": "你好",
                    "to": "zh-Hans"
                },
                {
                    "text": "Hola",
                    "to": "es"
                }
            ]
        },
        "text": "你好"
    }
}

Feedback & Support

Need help? Contact PubNub Support.

More integrations for you

Amazon Translate – Natural and fluent language translation

    Amazon Translate – Natural and fluent language translation

    Fast, high-quality, and affordable neural machine translation service

    Learn more

    Talk to an expert

    Contact Sales