Add blog post on unit of measurement translations (#2461)

This commit is contained in:
Abílio Costa 2024-11-21 19:00:44 +00:00 committed by GitHub
parent 7d40b0877c
commit 16f69ed65e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View 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.