question

jenson avatar image
jenson asked

"locale" information missing in Alexa HouseholdList event request / How to get multi language support in event handler?

Hi,

I have successfully integrated the Alexa.HousholdListEvents in my node.js / AWS lambda based skill. Now I am trying to use language translation as for usual Intents / Requests.

Unfortunately in the HousholdListEvent the "request" does not contain locale information and instead of a translated string I am getting just the identifier repeated when using t(). See example below.

Any advice? Help is appreciated!

Why do I have no locale information as part of the event?

Why is t() not working as expected (just like for normal intents)?

How could I translate in the event handler based on the origin locale?

My event request:

"request": {
        "type": "AlexaHouseholdListEvent.ItemsCreated",
        "requestId": "4a3d1715-e9b3-4980-a6eb-e4047ac40907",
        "timestamp": "2018-03-12T11:20:13Z",
        "eventCreationTime": "2018-03-12T11:20:13Z",
        "eventPublishingTime": "2018-03-12T11:20:13Z",
        "body": {
            "listId": "YW16bjEuYWNjb3VudC5BRVlQT1hTQ0MyNlRQUU5RUzZITExKN0xNUUlBLVNIT1BQSU5HX0lURU0=",
            "listItemIds": [
                "fbcd3b22-7954-4c9a-826a-8a7322ffe57c"
            ]
        }
    },

My translation usage:

this.t('MY_STRING_IDENTIFIER')

My result (in the ItemsCreated event handler):

MY_STRING_IDENTIFIER

Expected result (as for other requests):

"This is my translated text"
alexa skills kitalexa listslist api
3 comments
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

As of now I still cannot get the locale information from the received event and would have to fall back to english.

If you need further information - feel free to ask. I am more than happy to provide more details if needed.

Any advice how to get multi language support wihin a list event handler?

Help is appreciated!

Any workaround?

Thank you!

0 Likes 0 ·

According to https://developer.amazon.com/de/docs/custom-skills/develop-skills-in-multiple-languages.html#h2-code-changes the locale should be part of the request. Why is this not the case in my event? How can I get the locale information?

0 Likes 0 ·

List API FAQ information:

How should the developer handle localization of the To-Do and Shopping lists? The default lists (To-Do and Shopping List) list_id values are base-64 encoded strings with these formats: -TASK for the to-do list -SHOPPING_LIST for the shopping list Developers can base64 decode the list_id value and look for the specified string at the end. This string is constant and agnostic to localization.

0 Likes 0 ·
Amazon_Bernardo Bezerra avatar image
Amazon_Bernardo Bezerra answered

Hi exe222,

Thanks for posting your question to the forum. Sorry it took a while to get a feedback. We will investigate this issue further and keep you posted of any developments.

Regards,

Barry

3 comments
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I am still struggling with this issue...
Documentation states the following, so it seams "intended" behaviour:

"Note that list events and skill events that are sent to your service do not include the locale property."

https://developer.amazon.com/de/docs/custom-skills/develop-skills-in-multiple-languages.html

But there is no solution mentioned for this case - could anybody from Amazon please assist?

0 Likes 0 ·

Hi @jenson,

As you mentioned in your last message, this is the expected behavior of the platform, so unfortunately the feature you are trying to implement is not available.

You can post this as a feature request in our ideas space here and have other developers vote on it for future implementation.

Regards,
Barry

1 Like 1 ·
jenson avatar image jenson Amazon_Bernardo Bezerra ♦♦ ·

Thanks, will do so.

Very unfortunate that one cannot translate based on incoming events...

0 Likes 0 ·
jenson avatar image
jenson answered

If anybody runs into the same problem, please support the idea so that we may get the locale property anytime soon:

https://alexa.uservoice.com/forums/906892-alexa-skills-developer-voice-and-vote/suggestions/34621093-provide-locale-property-in-event-skillevent-list

10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.