PubNub Integration

IBM Watson: Language Translator

In-app chat

In-app chat

Last Updated:

2019/05/14

Author:

PubNub

API Documentation

Translate and publish text in realtime for 11 different languages

Language Translator from IBM Watson provides an API for translating and publishing text for 11 different languages. The IBM Watson Translator block allows you to translate text, whether it's as short as a chat messages or long as a news article, and deliver it to any number of subscribers, in realtime.

Walkthrough

This block enables communication between multiple participants in their native languages. It supports English, French, and Spanish but with some modifications to the block code, additional languages can be supported easily.

A message is sent to the input channel. Then it is translated using IBM Watson API while the message is in transit. The published message is appended with a translation before it reaches subscribers.

Multilingual translation can be especially useful for use-cases like customer support, social apps etc.

To learn more about IBM Watson language Translator API and get your own API credentials, visit the IBM Watson Language Translator API homepage.

Be sure to add your IBM Language Translator API key to the PubNub Functions Vault using the My Secrets button in the Functions Code Editor.

Input

Publish a message text on the input channel.

{
    "text": "Hi",
    "input_lang": "en"
}

Output (Spanish)

The text is translated and added to the message payload.

{
    "text": "Hola",
    "input_lang": "en",
    "original_text": "Hi",
    "output_lang": "es"
}

Feedback & Support

Need help? Contact PubNub Support.


Talk to an expert

Contact Sales