thomasloven / lovelace-card-mod

🔹 Add CSS styles to (almost) any lovelace card
MIT License
1.04k stars 169 forks source link

Dynamic title for card? #382

Open ultimate-tester opened 1 week ago

ultimate-tester commented 1 week ago

I'm trying to create a translation of my dashboard based on the language set in the user's profile settings. What I want to achieve is something like the following:

type: custom:mod-card
        view_layout:
          grid-area: first_floor
        card:
          type: grid
          title: |
            [[[
              if (user.language === 'nl') return '1e Verdieping';
              return 'First Floor';
            ]]]

Unfortunately this just displays the raw code as the title, it's not executed. Would it be possible to have a dynamic title for a card?