Languages

Every Dialogflow agent has a default language and once your default language is set, it can't be changed. You can only add languages to a Dialogflow agent in the settings for the Dialogflow agent. Dialogflow supports 19 languages too, and if you have more than one language for added in Dialogflow, you'll need to set a {{lang}} Custom User Field with a language code (i.e. en for English, or es for Spanish). This will tell Dialogflow which language to use. To add languages to an existing Dialogflow agent, click the ⚙ next to your agent name in Dialogflow and go to the language tab.

Dialogflow languages for Manychat

Add the languages you want to support with your ManyChat bot.

Dialogflow languages for Manychat

Each language has a special language code. You can click one of the language codes to toggle between language-specific versions of your Dialogflow intents. The Intent names will be the same across all languages you have included, while the training phrases and responses can be different depending on the language. If you delete some Intents in one language however, they will be deleted from the Intents in the other languages you've added to your Dialogflow agent because one set of Intents is common to all languages you add to your agent.

Dialogflow languages for Manychat

If your Dialogflow default language is English and you start creating Intents for English but then add another language like Spanish, you'll see the Intent names will also be in English when viewing the Intents in Spanish.

Dialogflow languages for Manychat

You'll want to have language-specific Flows in Manychat so it's a good idea to create a Flow in one language and then duplicate the Flow and translate the content into another language.

Dialogflow languages for Manychat

You can see in this English Flow that the first step is an Action with a Custom User Field lang that has a value of en. The lang Custom User Field must be lowercase and exactly as it appears here as that will tell Dialogflow to use a specific language, while the language code you use for the value should match Dialgoflow's language code values (i.e. en, es, da, etc..)

Dialogflow languages for Manychat

Click into a Flow you duplicated for your second language (The example here is Spanish) and change the value for the lang Custom Field to the corresponding language code (In the example, the value has been set to "es", Dialogflow’s language code for Spanish). Translate the messages in your steps into your desired language.

Dialogflow languages for Manychat

A best practice for a multi-language bot is to have a language selector in your Welcome Message. You'll also want to create one other intent, in case the user is chatting with your bot in one language, but then wants to switch languages in the middle of the converation. Using the example here, in the English version of the Intent you would include "Spanish", and "Español" as training phrases and in the Spanish version of the Intent include English as a training phrase. In each language version of the Intent, redirect to the corresponding Flow.