Build localized actions (Dialogflow)

You can localize your Actions for the Google Assistant to provide customized experiences for different languages and locales that users can set on their devices. In addition, you can restrict access to your Actions based on regions, or the physical location of your users.

Before moving on, it's useful to know a few terms to understand how you can cater your Actions to different users:

  • Language - An agreed upon, spoken and written mode of communication
  • Region - A defined physical area that's usually associated with a country
  • Locale - The combination of a language and region

Now that you understand some basic terms, here's how you can cater your Actions for different languages, regions, and locales in the Actions Console, Dialogflow, or fulfillment.

Supported languages and locales

See the languages and locales document for information on which locales your Action projects can support and the corresponding TTS voices for these locales. Users must set their Assistant locale setting to a supported locale to use your Actions.

Publishing

The Actions console lets you customize the following information when publishing your Actions project:

  • Language- and locale-specific information: You can specify different Action information details (such as name and description) at the language and locale level for each of your projects.
  • Location targeting: You can specify the regions where your Action is available. By default, your Action supports all regions, as long as your users have set their Assistant locale to one your Action supports.
  • TTS voice customization: By default, your Action automatically uses a set of TTS voices that corresponds to the user's Assistant locale. You can override this behavior and choose a specific TTS voice that doesn't change based on the user's Assistant locale.

See Publish localized Actions for more information on how to localize Action distribution.

Dialogflow agents

Dialogflow lets you create agents that support multiple languages and locales. For every language or locale, you can specify customizations such as different User says phrases and Responses.

See Dialogflow agents for more information on how to create localized agents.

Localized templates

Template Actions can be built to support a number of different languages, or multiple languages in the same Action by uploading a localized Google Sheet for each new language.

Different templates are available in different languages and locales. See the Templates documentation for more information about supported languages and locales for each template.

Fulfillment

When building your fulfillment, you can provide:

  • Language- and locale-specific responses: You receive the user's Assistant locale setting in each request to your fulfillment. You can use this string (for example, en-GB) to figure out how to return different responses based on a user's language or locale.
  • Region-specific responses - You can request permission to access the physical location of the device from the user. With this information you can further customize responses for regions.

See Fulfillment for more information on how to localize responses.

Testing

During development, you can test your localized Action with hardware devices or the Actions simulator with the following features:

  • Language simulation lets you set the locale of a device to test out locale-specific responses and logic in your Action.
  • Location simulation lets you set the physical location of the device to test out location targeting and any region-specific responses in fulfillment.

See the Actions simulator documentation for more information on how to test localized Actions with the Actions simulator.