Ceridan Ceridan - 6 days ago 4x
Node.js Question

MS Bot Framework (Nodejs): How to change language of Prompt dialog?

The problem is when I use Prompts for example:

Prompts.confirm(session, "Are you sure?");

Bot asks:

Are your sure? (1. Yes, 2. No)

It's ok, because it uses default language, but when I need to ask something on other language this additional part
(1. Yes, 2. No)
doesn't change. So how can I change language for Prompt or for all dialogs from code?

Muz Muz

You can override the default prompt confirm_yes and confirm_no values within your own BotBuilder.json file.

Take a look at the localization example here: https://github.com/Microsoft/BotBuilder/blob/master/Node/examples/basics-localization/app.js to see how where to place the BotBuilder.json file.

Here's an example of my bot's locale/en/BotBuilder.json:
{ "confirm_yes": "yep", "confirm_no": "nope"

and locale/es/BotBuilder.json:
{ "confirm_yes": "sip", "confirm_no": "nop"