Language Support in Orbita Chatbot

Orbita provides multilanguage support allowing you to change the labels in the chatbot.

Refer How to configure a multi-lingual bot to change the voice output of the chatbot.

Experience Designer

You can change all the labels in the Chatbot to the desired language using the below steps.

  1. Login to Orbita Experience Manager.

  2. Open Experience Designer, from Side menu > Briefcase icon > Develop > Experience Designer.

  3. Import Language Flow (attached at the end of the document) to the Experience Designer. Refer How do I export and import flows in Experience Designer

  4. You can take one of the function nodes (en-US, Spanish) as a reference and construct the code for your language.
    Make sure to change the langPack and name properties to the root language code. For example, if the language is French the root language code will be fr

  5. Go to your Chatbot flow and insert a function node with the below code in between the Httpin node and Bot View Template node.

var languages = msg.req.headers["accept-language"].split(';'); var languages = languages.map(function(item){ var temp = item.split(','); if(temp[0].indexOf('=') ===-1) { return temp[0]; } return temp[temp.length-1]; }); var langPack = global.get('orbitalang-pack') || {}; node.warn(languages) var selectedLang = null; for(var i=0; i<languages.length; i++) { if(langPack[languages[i]]) { node.warn(languages[i]); selectedLang = langPack[languages[i]]; break; } } if(!selectedLang) { selectedLang = langPack['en-US'] } if(!msg.bot) { msg.bot = {}; } msg.bot.selectedLang = selectedLang; return msg;

Browser Settings

You have to Add and/or Arrange the languages in your browser settings for the language support to take effect in your browser. The language you are trying to add should be at the top of the language list of the browser.

  File Modified

File Language.json

Aug 26, 2020 by Rajkiran Alla

Related Articles