Annotations in the Alexa Conversations Core Library
Note: Sign in to the developer console to build or publish your skill.
Note: Alexa Conversations Description Language (ACDL) is offered as a beta and may change as we receive feedback and iterate on the feature.
The Alexa Conversations Core Library (ACCL) provides annotations that you can use in Alexa Conversations Description Language (ACDL) files.
Note: Version 2.29 of the Alexa Skills Kit Command Line Interface (ASK CLI) is now available. This single tool lets you work with all Alexa skills, including Alexa Conversations Description Language (ACDL) skills, interaction model skills, and skills that use both. You can continue to use the current ASK CLI for ACDL, but it will no longer be updated. To get the latest supported features and functionality, use version 2.29 or later.
@locale
You localize your Alexa Conversations skill by using the @locale
annotation. You can apply the @locale
annotation to a name declaration, a dialog, or a sample. You can then use the variations()
action to aggregate localized events or responses into one event or response that you can use in a locale-agnostic dialog.
Note: Expressions without the
@locale
annotation are global. In other words, the expressions apply to all locales.Examples
The following example shows how to use the @locale
annotation to specify that the skill supports en-US
.
@locale(Locale.en_US)
welcome_en = apla("/lib/prompts/en/welcome")
The following example shows how to specify locales for samples under a dialog.
@locale(Locale.de_DE, Locale.en_US)
dialog Nothing myGreetingBot {
// This sample will be deployed to de-DE.
@locale(Locale.de_DE)
sample {
expect(Invoke, hello)
...
}
// This sample will be deployed to en-US.
@locale(Locale.de_DE)
sample {
expect(Invoke, hello)
...
}
// This sample will be deployed to en-US and de-DE.
sample {
expect(Invoke, hello)
...
}
}
Related topics
Last updated: Nov 27, 2023