Annotations in the Alexa Conversations Core Library

The Alexa Conversations Core Library (ACCL) provides annotations that you can use in Alexa Conversations Description Language (ACDL) files.

@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.

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)
    ...
  }
}