diff --git a/docs/internationalization/core.md b/docs/internationalization/core.md index 4294e063..a5d07517 100644 --- a/docs/internationalization/core.md +++ b/docs/internationalization/core.md @@ -467,6 +467,24 @@ If your integration provides entities under its domain, you will want to transla } ``` +#### Unit of measurement of entities + +Integrations can provide translations for units of measurement of its entities. To do this, provide an `entity` object, that contains translations for the units and set the entity's `translation_key` property to a key under a domain in the `entity` object. +If the entity's `translation_key` property is not `None` and the `entity` object provides a translated unit, `SensorEntityDescription.native_unit_of_measurement` and `NumberEntityDescription.native_unit_of_measurement` will be ignored. + +The following example `strings.json` is for a `sensor` entity with its `translation_key` property set to `goal`: +```json +{ + "entity": { + "sensor": { + "goal": { + "unit_of_measurement": "steps" + } + } + } +} +``` + ## Test translations In order to test changes to translation files, the translation strings must be compiled into Home Assistant’s translation directories by running the following script: