I'm trying to use a Translate API webhook to enable multi-language functionality in my DialogFlow agent.
- The intents are configured in English
- When text is input to the bot in any other language, it goes to the Default Fallback Intent where the webhook is called for translating this text. The translated output and the user language context are returned.
- If I knew exactly what intent was to be triggered next in sequence, I could just have a Follow-up Event configured for this. But here the bot's output is translated text which shouldn't print but needs to be matched against all the English intents to see which is a hit. Then the output defined in the matching intent should be translated again to the user's language and produced as output.
Not sure how to have the translated text from the fulfillment go through all the intents and match accordingly. Please help?
For your step 3, you'll want to call Dialogflow's API with the translated text. If you're using Dialgogflow v1, you'll be calling the /query endpoint. If you're using Dialogflow v2, you'll need to have a session setup and then use the detectIntent action.
You'll then take the result you get back from this call and translate it back into the user's language, and send the result to them.