A Simple Guide and Solution to Using Resource Bundles in Custom Components by Frank Nimphius

 

imageA 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

  • Call a translation service from the custom component implementation code before sending a message. This option is suitable if the messages are not composed in the custom component but queried from a remote backend. Here auto-translation will help making the strings available in the bot user preferred language.
  • Use message bundles to provide translated responses for the languages you want the bot to support. Message bundles can use placeholders in the translated strings for the custom component to insert data value at runtime. Message bundles in custom components are a viable option if the custom component queries data from a remote service to integrate in a bot response.

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. Read the complete article here.

 

Developer Partner Community

For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

clip_image003 Blog clip_image005 Twitter clip_image004 LinkedIn image[7][2][2][2] Facebook image Meetups

Technorati Tags: PaaS,Cloud,Middleware Update,WebLogic, WebLogic Community,Oracle,OPN,Jürgen Kress

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.