jschnurr / botkit-middleware-dialogflow

Botkit middleware for Dialogflow (formerly api.ai). Supports Dialogflow API v1 and V2.
MIT License
29 stars 18 forks source link

Added capability to change language in Dialogflow #10

Closed lomluca-zz closed 6 years ago

lomluca-zz commented 6 years ago

I added few lines to support multi-language in Dialogflow. I suppose that in the message object the field "language" could be present: if not undefined, the language field of the apiai instance is updated accordingly: app.language = message.language

In this way Dialogflow will answer in the same language of the user, if trained.

jschnurr commented 6 years ago

Take a look at the dev branch; I merged your changes, and made a few additions:

Please test and comment if possible.

lomluca-zz commented 6 years ago

Good additions. I've read everything, it seems ok. I tried to use dev branch module in my node app and it runs perfectly. Thanks!

jschnurr commented 6 years ago

Merged and released in 1.4.0.