Moon phases are not translated

I have English as HA language but I want that moon phases are translated to Swedish.
My template looks like this but still moon phases are in english.

template:
  - sensor:
      - name: Månfaser
        state: >
          {% set phase = states('sensor.moon_phase') %}
          {{ { 'new_moon': 'Nymåne',
               'waxing_crescent': 'Tilltagande månskära',
               'first_quarter': 'Tilltagande halvmåne',
               'waxing_gibbous': 'Tilltagande gibbousmåne',
               'full_moon': 'Fullmåne',
               'waning_gibbous': 'Avtagande gibbousmåne',
               'last_quarter': 'Avtagande halvmåne', 
               'waning_crescent': 'Avtagande månskära' }.get(phase, phase) }}
        icon: >
          mdi:moon-{{ states('sensor.moon_phase').replace('_', '-').replace('-moon', '') }}

Where are they still in English? The state of your sensor.manfaser should be your translated text assuming:

  1. sensor.moon_phase exists on your system;
  2. The state of that sensor is exactly one of the translation keys you have provided — if it is not, your template will return the English version.

Where have you put that template YAML? Should be in configuration.yaml, and you should only have one template: key in the file. If this is your first YAML template, you will need to restart HA.

The template is in configuration.yaml and I have only one template.
As you can see from attached image I get English text … ‘Waxing gibous’ instead of ‘Tilltagande gibbousmåne’

sensor.moon_phase is not modified by your template, your template creates a new entity (sensor.manfaser?) which has the new value. So you would need to add that entity to entities card instead.

Thanks … now it works … I mixed up the sensors.

But I have another translation problem.
I use ‘weather forcast card’ and get the english weather state (Sunny) … how can I get swedish (Soligt)

Probably not possible unless you change your language settings to swedish.

OK … good to know