Localization
Use an i18next file to localize and change text for your music service in the Sonos app.
i18next file
Every music service implementation must include a URL localization text for all supported languages. Upload this file in the Localization Resources page of the Developer Portal. See Submit your service for details. When using an i18next file, use the following JSON format:
{
"en-US":{
"common":{
"service-description":"Insert description text here",
"service-promo":"Insert promo text here"
},
"integration":{
"custom-section-name": "Insert custom section text here.",
...
}
},
"es-ES":{
"common":{
"service-description":"Insert summary text here",
"service-promo":"Insert promo text here"
},
"integration":{
"custom-section-name": "Insert custom section text here.",
...
}
},
}
Section types
Localization resources are divided into two types within the i18 file: common and integration.
Common type
This type contains all the required sections for the localization resource. These sections include:
- Service Description
- Service Promo
Every i18 localization file must have these sections filled out.
Integration type
The integration type contains all other sections that you decide to add. You can customize these sections according to your needs.
Add strings for accessibility
The Sonos app uses strings for accessibility features, such as voiceover or talkback. To help with accessibility, be sure use values specific to the actual usage of the action. For example, instead of:
"en-US":{
"common":{
...
},
"integration":{
"THUMBS_UP":"Improving recommendations",
"THUMBS_DOWN":"Improving recommendations",
"REMOVE_THUMBS_UP":"",
"REMOVE_THUMBS_DOWN":""
},
}
use:
"en-US":{
"common":{
...
},
"integration":{
"THUMBS_UP":"Thumbs up",
"THUMBS_DOWN":"Thumbs down",
"REMOVE_THUMBS_UP":"Thumbs up removed",
"REMOVE_THUMBS_DOWN":"Thumbs down removed"
},
}
Provide a translation that...
- Briefly describes the element.
- Begins with a capitalized word. This helps VoiceOver read the label with the appropriate inflection.
- Is localized. Be sure to make your application available to as wide an audience as possible by localizing all strings, including accessibility attribute strings. In general, VoiceOver speaks in the language that the user specifies in international settings.
See Apple Accessibility Programming Guide for IOS for details.
Add strings for all languages supported by Sonos
Add strings for the languages below, even if your service is not offered in all of the locales listed. This will ensure that a Sonos listener with their device set to a different language will be able to use your service in their language. For example, if your service is intended only for a US audience, you should still have strings for Spanish, because some users in the US may have their devices configured to that language. If you only have en-US strings defined, they will only see and hear English strings, regardless of their device settings.
Sonos-supported languages:
Language Code | Language |
---|---|
en-US | English |
da-DK | Danish |
de-DE | German |
es-ES | Spanish |
fr-FR | French |
it-IT | Italian |
ja-JP | Japanese |
nb-NO | Norwegian |
nl-NL | Dutch |
pt-BR | Brazilian Portuguese |
sv-SE | Swedish |
zh-CN | Chinese (simplified) |
Service Promo
Your service requires a JSON key named service-promo
for each language.
The Sonos app presents this text to the listener as they go through the Content Service Setup Wizard.
Localization Resources custom fields
You can also enter translation text directly into fields in the Localization Resources page of the Developer Portal, along with custom translation sections.
Updated 8 months ago