thomasloven / lovelace-template-entity-row

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

Localization: how to pass a <key> into a <key> #82

Closed ildar170975 closed 4 months ago

ildar170975 commented 1 year ago

This code shows a localized "Home" or "Away" strings:

      - type: custom:template-entity-row
        entity: person.ildar
        name: localized
        state: _(component.device_tracker.state._.{{states(config.entity)}})

Here component.device_tracker.state._.home and component.device_tracker.state._.not_home keys are used.

Some keys have "internal" keys, like:

ui.errors.config.key_missing: "Required key ''{key}'' is missing.”

To show the whole message, I need to pass a "key" into it.

How should I combine the _(ui.errors.config.key_missing) and this "internal" key?

ildar170975 commented 1 year ago

Potentially may be closed by this PR: https://github.com/thomasloven/lovelace-template-entity-row/pull/85

thomasloven commented 4 months ago

Fixed by #85