question

fedeonline avatar image
fedeonline asked

Is there a way to localize Alexa.ModeController friendlyNames for different languages?

I'm trying to deploy a multi language Alexa SmartHome Skill. But I can't find a way to localize my Alexa.ModeController friendly names.

If I wrote something like this in my Discovery.Response, the discovery fails to discover any device.

supportedModes: [
        {
          value: "Cromo.White",
          modeResources: {
            friendlyNames: [
              {
                "@type": "text",
                value: {
                  text: "Blanco",
                  locale: "es-ES",
                },
              },
              {
                "@type": "text",
                value: {
                  text: "Bianco",
                  locale: "it-IT",
                },
              },
            ],
          },
        },

The discovery is successfull only if the locale is the same across all the supportedModes resources.

So How can I deploy a multi language smart home skill?


alexa smart homelocales
10 |5000

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

1 Answer

Anand@Amazon avatar image
Anand@Amazon answered

Hey @fedeonline

Thanks for reaching out to us !!

Unfortunately, customized text is not allowed for other locales except en-US so you can use "assetId" for commands.

Ex :

"modeResources":
{
  "friendlyNames": [
    {
      "@type": "asset",
      "value": {
        "assetId": "Alexa.Setting.Night"
      }
    }
  ]
}

To get list of different asset ID and its values check this link.

2 comments
10 |5000

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

Hey, for the "Unfortunately, customized text is not allowed for other locales except en-US " --- I am not very understand, the document sample code use customized text :

https://developer.amazon.com/en-US/docs/alexa/device-apis/resources-and-assets.html#global-alexa-catalog

"capabilityResources": {
                "friendlyNames": [
                  {
                    "@type": "text",
                    "value": {
                      "text": "Coffee pods",
                      "locale": "en-US"
                    }
                  },
                  {
                    "@type": "text",
                    "value": {
                      "text": "Cápsulas de Café",
                      "locale": "es-MX"
                    }
                  },
                  {
                    "@type": "text",
                    "value": {
                      "text": "Capsules de café",
                      "locale": "fr-CA"
                    }
                  }
                ]
              }
1 Like 1 ·

@ihxn You answered your own question. It works perfectly fine the way it is currently documented.

The answer @Anand@Amazon provided was how it used to be documented when the generic controllers (previously called Building Block APIs) were released.

0 Likes 0 ·