mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-11 19:36:29 +00:00
Add blog post on unit of measurement translations (#2461)
This commit is contained in:
parent
7d40b0877c
commit
16f69ed65e
23
blog/2024-11-21-unit-of-measurement-translations.md
Normal file
23
blog/2024-11-21-unit-of-measurement-translations.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
author: Abílio Costa
|
||||||
|
authorURL: https://github.com/abmantis
|
||||||
|
title: "Translating units of measurement"
|
||||||
|
---
|
||||||
|
|
||||||
|
Home Assistant 2024.12 will support the translation of custom units of measurement. Previously, those would have been hardcoded in their integrations.
|
||||||
|
|
||||||
|
Just like for entity names, integrations just need to set the `translation_key` on the entity definition and provide the unit designation in the `strings.json` file (with the new `unit_of_measurement` key):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"entity": {
|
||||||
|
"sensor": {
|
||||||
|
"subscribers_count": {
|
||||||
|
"unit_of_measurement": "subscribers"
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Check our [backend localization documentation](/docs/internationalization/core#unit-of-measurement-of-entities) for details.
|
Loading…
x
Reference in New Issue
Block a user