Multilingual ChatBot

You’ll need to build a Custom Pipeline Component (read more) that detects the language of the input.

Again you have multiple possibilities:

1. Understand and respond in only French and English:

Introduce intents with examples in both English and French.

- intent: greet
  examples: | 
  - hello
  - bonjour
etc...

Your Component will only detect the language only and save it.

All your responses will need to be Custom Actions; in which you access the language and dispatch the correct message accordingly:

if language == "fr":
    dispatcher.utter_message("Salut! Comment puis-je vous aider?")
    #/* or dispatcher.utter_message(response = "utter_greet_fr") */
else:
     dispatcher.utter_message("Hey! How can I help you?")
    #/* or dispatcher.utter_message(response = "utter_greet_en") */

2. Understand and respond in any language:

Introduce intents with examples in English only.

- intent: greet
  examples: | 
  - hello
  - hey there
etc...

Your Component will detect the language, save it, and then translate the user input into English before passing it to the rest of the Pipeline, which will therefore process the translated English text and match it to an intent.

All your responses will need to be Custom Actions; in which you access the language, and translate then dispatch the message accordingly:

english_text = translateEnglish("Hey! How can I help you?", language)
dispatcher.utter_message(english_text)

As previously, solution 2 is better but harder to implement.