Translating custom component

Hi there,

i would like to localize a custom component and have visited the official documentation.
https://developers.home-assistant.io/docs/en/internationalization_custom_component_localization.html

I think i understand the approach, but how do i need to define the de.json etc and how can i use a key in code?

class GardenaSmartFrostWarningSensor(GardenaSmartBinarySensor):
    def __init__(self, hass, sensor):
        """Initialize the sensor."""
        super().__init__(hass, sensor)
        self._name = sensor.name + " ambient frost warning"
        self._device_class = 'cold'

    @property

I would like to localize as example the following string:
" ambient frost warning"

Thanks for your support.

I would like to do a similar thing. Did you have any luck so far?

Nope. I have no clue.

Hi, I have to do the same.

How do it?

1 Like

Do you find something to translate entity name ?