1

I have built a Dialogflow app in english. I used a NodeJs webhook to provide the answers.

Now, I want to add a new language (Spanish). Is there a way to add it without duplicating the webhook?

Is there a prebuilt Library ,like I18N, where I provide the translation and depending on the "languageCode": "en", I send the answer?

1 Answers1

0

The general solution is for you to use a localization library of your choice, send it a string identifier, and send the response that it generates. There are several libraries that Google suggests, however you should be able to use whichever one works best for you. There are some issues using i18n-node if you are using asynchronous code - the problems and solutions are also discussed by the team.

There is also the multivocal library, which takes a different approach to generating responses, but has localization built-in.

Prisoner
  • 49,922
  • 7
  • 53
  • 105