mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-21 16:26:30 +00:00
Add selectors select for backend backend localization (#1622)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
355a77e578
commit
a772e60596
@ -15,6 +15,7 @@ The `strings.json` contains translations for different things that the integrati
|
||||
| `device_automation` | Translations for device automations. |
|
||||
| `issues` | Translations for repairs issues. |
|
||||
| `options` | Translations for the options flow. |
|
||||
| `selectors` | Selectors of the integration. |
|
||||
| `state` | States of the integration, keyed by device class. |
|
||||
|
||||
### Title
|
||||
@ -54,6 +55,42 @@ The translation strings for the configuration flow handler and the option flow h
|
||||
}
|
||||
```
|
||||
|
||||
### Selectors
|
||||
|
||||
The translation for selectors are defined under the `selector` key. It supports option label translations for the selector `select`. The integration should set the `translation_key` on the selector select configuration. This allows translations on select selectors used in config and options flows. An example strings file below describes the different supported keys.
|
||||
|
||||
```json
|
||||
{
|
||||
"config": {
|
||||
"flow_title": "Discovered Device ({host})",
|
||||
"step": {
|
||||
"init": {
|
||||
"title": "The user visible title of the `init` step.",
|
||||
"description": "Markdown that is shown with the step.",
|
||||
"data": {
|
||||
// Config flow selector select with options that support translations
|
||||
"set_ca_cert": "Broker certificate validation"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// Translations for selector select to be used in option and config flows
|
||||
"selector": {
|
||||
// The key is linked to the `translation_key` that needs to be set
|
||||
// together with `translation_domain` using the SelectSelectorConfig class
|
||||
"set_ca_cert": {
|
||||
// The translations for the selector select option labels
|
||||
"options": {
|
||||
"off": "Off",
|
||||
"auto": "Auto",
|
||||
"custom": "Custom"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### Device automations
|
||||
|
||||
The translation strings for device automations are defined under the `device_automation` key. An example strings file below describes the different supported keys.
|
||||
|
Loading…
x
Reference in New Issue
Block a user