Search code examples
alexa-skills-kit

Locale ignored in APLA Alexa Developer Console


I'm new to developing skills with Alexa. I've followed the Build Multi-turn Skills Tutorial with Alexa Conversations tutorial up to module 3.

Because I want to develop a skill only for German users I've altered the language settings in the Alexa developer console of my skill to only support German language.

I change the APLA code in the tutorial with the APLA with the "edit audio response" to this:

{
    "type": "APLA",
    "version": "0.8",
    "mainTemplate": {
        "parameters": [
            "payload"
        ],
        "item": {
            "type": "Selector",
            "strategy": "randomItem",
            "items": [
                {
                    "type": "Speech",
                    "contentType": "text",
                    "when": "${environment.alexaLocale == 'de-DE'}",
                    "content": "Willkommen bei meiner App"
                },
                {
                    "type": "Speech",
                    "contentType": "text",
                    "when": "${environment.alexaLocale == 'de-DE'}",
                    "content": "Willkommen."
                },
                {
                    "type": "Speech",
                    "contentType": "text",
                    "when": "${environment.alexaLocale == 'en-US'}",
                    "content": "Welcome."
                }
            ]
        }
    }
}

At the bottom of the console I see that my locale is set to German but when I preview the APL above the audio player always says "Welcome." with the English voice, the other two options are never triggered. What am I missing here?


Solution

  • The audio response tool doesn't take in account the language of the website. There are no ways to test the condition environment.alexaLocale in this tool.

    To test it, update the code of your skill and test it either on the test tabyour skill in the developer console or directly on a real device. Just tested with your code, it works perfectly. Just not on the audio tool.