As Alexa expands to more countries, you have more opportunities to create voice-first experiences for customers in multiple languages and regions, and make your skills available to a growing audience.
Localization of your skill isn’t limited to just language, however. It also applies to the content that you serve to customers spread across these regions. Even if you think your content is applicable to a global audience and simply needs translation, you should consider creating region-specific content to fully engage your customers.
Here are five tips to help you think through the voice design process and create standout skills in multiple languages.
Check out this blog post for step-by-step instructions to add a new language model to your skill. Start by localizing the built-in slots and speechcons within your voice user interface (VUI). The built-in slot types available depend on the language selected for your skill. Check the available built-in slots for each supported language and update your skill's interaction model accordingly. For example, built-in slot types AMAZON.US_FIRST_NAME, AMAZON. US_CITY are available for US English, UK English, and German. For Japanese, English (India), English (Canada), English (Australia), and French language models, instead consider AMAZON.FirstName and AMAZON.City built-in slot types.
Speechcons are special words and phrases that Alexa pronounces more expressively. You can include these exclamations in your skill's text-to-speech using SSML. This means you can now build Alexa skills that pronounce common words for each language in a more natural and conversational way. For example, you can use regionally specific terms such as “Balle Balle” and “aiyo” in India, or “Bon appetit” and “Bon voyage” in French. Check out our full list of speechcons for UK English, German, French, English (India), English (Australia), Japanese, English (Canada), and US English.
You may want your skill to respond differently based on the user’s locale. For example, let’s say you're building an audio skill that has several audio files for different languages and you want to serve the audio file based upon the user's locale. If your skill supports both German and English (India), you would want the same code base to:
You can determine the language/locale used to invoke the skill by checking the locale property included in all requests sent to your skill by Alexa (for example, 'LaunchRequest' or 'IntentRequest').
The locale property is part of the request object:
{
"request": {
"type": "LaunchRequest",
"requestId": "EdwRequestId.00000000-0000-0000-0000-000000000000",
"timestamp": "2016-06-14T20:59:24Z",
"locale": "en-US"
}
}
If you’re using the Alexa Skills Kit SDK for Node.js, you can check this using this.event.request.locale. You can drop the following helper code to easily provide locale-based resources:
Step 1: Initialize the language resources.
//Initializing default English language resources
let en = {
url: 'https://audio1.maxi80.com',
startJingle: 'https://s3.amazonaws.com/ask-soundlibrary/musical/amzn_sfx_trumpet_bugle_03.mp3'
}
//Initializing English India resources
let india = {
url: 'https://audio1.maxi80.com',
startJingle: 'https://s3.amazonaws.com/alexatest99/Namaste.mp3'
}
//Initializing German resources
let de = {
url: 'https://audio1.maxi80.com',
startJingle: 'https://s3.amazonaws.com/alexatest99/German.mp3'
};
Step 2: Map the language resources to their respective locale values.
//Map the resource data to locale value sent in every Alexa request
let globalResourceData = {
'en-US': en,
'en-GB': en,
'en-CA': en,
'en-IN': india,
'en-AU': en,
'fr-FR': en,
'de-DE': de
};
Step 3: Use this helper function to determine the request locale.
//This function takes the Alexa request object to fetch the user locale and determine the resource accordingly
function resourceData(request) {
let DEFAULT_LOCALE = 'en-US';
if (request !== undefined && request.locale !== undefined) {
var locale = request.locale;
}
else {
var locale = DEFAULT_LOCALE;
}
return globalResourceData[locale];
}
Step 4: Use the helper function to determine the locale inside an intent handler.
let request = this.event.request;
console.log("URL value is "+resourceData(request).url);
const speechOutput = "I see that you're coming from " + this.event.request.locale + " Here's your audio <audio src='" +resourceData(request).startJingle+ "' /> ";
For a more in-depth look at using locale-specific values and leveraging this helper function, see the Single Stream Audio Skill code snippet. You can also check out the audioAssets.js.
The code above determines the user’s locale to fetch the data dynamically. If you are serving resources like images, audio, or video files in your skill using Amazon S3, consider hosting these resources on an S3 bucket hosted in an AWS region closer to the user. Use this code as a starting point and modify as necessary to fetch the S3 URL based on the user's locale. This will help reduce latency in serving these static assets.
Tailor your content to local needs and tastes. To make your skill content engaging for all the locales you are publishing, consider local taste, social norms, and nuances like units of measurements, for example. Celsius is the unit for temperature in the UK, whereas its Fahrenheit in the US.
As you start your multi-language skill-building journey, it’s important to think about what makes a skill engaging for customers in each locale—and what keeps customers coming back over time. Reference one of our most popular resources in the Alexa Skill Builder’s Guide, “7 Tips for Building Standout Skills Your Customers Will Love,” to get a deep dive on the characteristics of highly engaging skills.
Make sure you test the skill for the languages you’re targeting. You can use the Test Simulator to test your Alexa skill without owning a device. On the Test page, select the language, then enter the utterance or provide voice input to test. Learn more about why testing and automation matter to build engaging Alexa skills.
Monitor your skill ratings and reviews in the Alexa Skills Store to understand what users think of your skill and address any issues you may not have spotted during testing. You can also leverage the skill metrics dashboard to evaluate skill engagement across different languages supported by your skill.
I hope this post has helped you understand how you can make engaging multi-language skills. If you have any questions, let's continue the discussion. You can contact me at @ankitkala99 or seek us out at an Alexa Dev Days in your city.
Every month, developers can earn money for eligible skills that drive some of the highest customer engagement. Developers can increase their level of skill engagement and potentially earn more by improving their skill, building more skills, and making their skills available in in the US, the UK, India, and Germany. Learn more about our rewards program and start building today.