Reputation: 3271
I'm currently working on an action using the Actions on Google SDK together with Microsoft's Bot Framework. In this action I've build a fallback that allows the user to enter a product code on their phone if they have failed to do so a couple times through voice. This setup works fine in English, but my action is multi-lingual and supports Dutch and French too.
The problem that I am running into is, when a user is using my action in Dutch or French, when they accept to move the conversation to their phone, the conversation continues in English once it is on my phone. Below you can find an the code I use in my handler.
New Surface handler
endpoint.intent(GoogleIntentTypes.NewSurface, async (conv: ActionsSdkConversation) => {
logger.logDebug("Received new surface request")
const locale = conv.user.locale;
if (conv.arguments!.get('NEW_SURFACE')!.status! === 'OK') {
conv.ask(this.messages.getResponse("AskForProductNumber_SSML", locale));
} else {
conv.close(this.messages.getResponse("EndConversation_SSML", locale));
};
});
From the moment the request enters my webhook, my conversations locale is switched to en-US. This makes me think that the locale is taken from a setting on my phone, but I can't find anything in the docs on this. Does anyone know what could be causing the switch in locale when performing a handover to phone?
Upvotes: 1
Views: 36
Reputation: 50731
My understanding is that the locale is based on the locale of the device that has sent the request.
This page on "languages and locales" (emphasis mine) says:
Locales are constructed using the language set in the Assistant settings and the region set in the device settings. The combination of these needs to form a supported locale. For example, a device set to the BR region and an Assistant device set to en-US results in a en-BR locale, which is not supported by Actions on Google.
Upvotes: 2