alexa-samples / alexa-smarthome

Resources for Alexa Smart Home developers.
https://alexa.design/smarthome
Other
680 stars 336 forks source link

Lokal detection in lambda function #120

Closed farazmemon closed 9 months ago

farazmemon commented 5 years ago

Is it possible to detect lokal in a a lambda function for smart home skill API?

Our skill supports responses in German (DE), English (UK), and French (FR). The lambda function handling the requests for all these languages/countries is obviously in the same region (EU Ireland). How do we determine what language the user used for triggering our skill?

Do we need to deploy three different lambda function in the same region to support different languages? Currently we are using only one.

aszk commented 9 months ago

No, you don't need to deploy different lambda function in the same region for different languages that are supported by the same region nor need to know which locale the user is using. For the smart home skills, interaction models are built by Amazon so as long as you deploy your skill code on certain endpoint (on EU Ireland in this case), your EU skill endpoint will receive requests from Alexa. Alexa decides an endpoint to use depending on a marketplace the user is registered. Please see the document for more details. https://developer.amazon.com/en-US/docs/alexa/smarthome/develop-smart-home-skills-in-multiple-languages.html