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 real time.
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.
Publish a message text on the input channel.
{ "text": "Hi", "input_lang": "en" }
The text is translated and added to the message payload.
{ "text": "Hola", "input_lang": "en", "original_text": "Hi", "output_lang": "es" }
Need help? Contact PubNub Support.
Copyright (c) 2018 PubNub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.