thomasloven / lovelace-template-entity-row

🔹 Display whatever you want in an entities card row.
MIT License
210 stars 16 forks source link

entity state translations are not working #90

Closed ChristophCaina closed 4 months ago

ChristophCaina commented 1 year ago

Another Issue I've just noticed is related to translated states of an entity.

I want to use the template-entity-row for a door-handle sensor. This sensor can have the following states:

closed / opened / tilted

While using the entity in a normal entities card, the state will be translated into my UI language just as expected. As soon, as I use the template-entity-row on this entity, the state will be shown in language:

Card with enabled template-entity - the last entity is with applied template: grafik

Card with the same entity applied with - and without template: grafik

It would be nice, if the entity row would support the built in UI translation. I know, I could change that by adding an if / else to the 'state'... but that will cause issues, when someone would change the UI language in the user-settings.

ildar170975 commented 1 year ago

You said "translations are not working" - but you did not use a localization. image

I suggest you to ask questions in the Community in a dedicated thread and leave Github for bugs, FRs & PRs. Check this example:

type: entities
entities:
  - cover.garage_door
  - type: custom:template-entity-row
    entity: cover.garage_door
    name: Door
    state: My door is _(component.cover.state._.{{states(config.entity)}})

image image

ChristophCaina commented 1 year ago

Hi, thanks... I haven't seen this information - else, I would not have posted an issue :)

What I don't really understand - why can't the localization be done directly from the mod?

Anyway, thanks for the information :)

ildar170975 commented 1 year ago

why can't the localization be done directly from the mod?

This is a part of the mod.

ildar170975 commented 4 months ago

can be closed

thomasloven commented 4 months ago

It cannot be done directly by the row because it cannot read your mind. The purpose of this is to display a line with exactly the information you put there, and as little magic as possible.

Sure, most of the time, if you put an entity you'd want the translated state. Except where you don't, and what then?