Fulfilment for 'en' local when msg from telegram

382 views Asked by At

I write a telegram bot, I use Dialogflow and Dialogflow Fulfillment Library . When I receive messages from telegram the Dialogflow Fulfilment Library always recognize messages on en local (agent.locale always return en). No matter what a language I use in messages. I write the message on Cirillic, but on the server I get local en and intent recognize like en. How Dialogflow recognize locale for request and how can I change local on ru ?

1

There are 1 answers

0
RikH On

I'm not sure what exactly you have implemented. If I understand correctly you expect Dialogflow to automatically detect language. For the API V2 I noticed that you have to specify language_code explicitly. This makes sense, since some user system could start classifying poorly if the intents are defined in language A and some input is falsely interpreted as language B. This could occur if users do use language A, but include borrowed words ('computer' is also a Dutch word for example) or use names (for example, 'Where is Berlin Hauptbahnhof?')

For API v2 it seems you can try to set agent.locale in v2-agent.js.