Sample by Frank Nimphius, March 2018
A common requirement for bots is to support multiple languages. To address this requirement, Oracle Intelligent Bots provides the ability to configure translation services from Google and Microsoft to auto-translate user input messages and bot responses. If you don't want bot responses to be auto-translated then a second option is to use Resource Bundles instead.
All the before mentioned options work great for building multi lingual bots, but require messages to be defined in the dialog flow, or saved in context variables. This excludes custom components that directly write user responses to the message channel using the bot SDK conversation.reply( … ) function.
Without going into a longer discussion of when custom components should write message responses directly to a message channel and when they should save messages or data in a context variable, we simply accept the fact that there are use cases for custom components to be self-contained. This however then bears the question of how to implement translations for those responses.
To translate bot responses sent directly from a custom component, you have two options
The article (readme), and its sample, shows a simple solution to implement message bundle support in custom components. You can leverage the sample sources in your own custom component projects, and the readme in the sample tells you how.
The image above shows the sample at runtime. When a German string is issued, then the custom component response is in German. If French, then the response is in French (well, you get the idea)
Oracle Intelligent Bots has been rebranded Oracle Digital Assistant to better describe its capabilities beyond a standard chatbot. To learn more, visit cloud.oracle.com/digital-assistant