home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
4.06k stars 2.78k forks source link

Entity names don't follow the user language setting #22210

Open NoRi2909 opened 1 month ago

NoRi2909 commented 1 month ago

Checklist

Describe the issue you are experiencing

When changing the user language all entity names don't follow that change but are stuck at the system language.

This creates a messed up user interface and makes localization checks extremely time-consuming, too.

The problem can be reproduced in any integration that uses entity names, notabily Sun, Matter, WLED, Xiaomi Miio to name a few.

Describe the behavior you expected

If entity names are localized, they should always been shown in the user language.

Steps to reproduce the issue

  1. Have your system and user languages set to be identical.
  2. Open some integration that uses entity names: Sun, Matter, WLED, Xiaomi Miio, e.g.
  3. Verify that the UI is consistent under "Diagnostics" etc.
  4. Now change your user language to a different language.

With the system language set to German and the user language set to English you will get this in the Sun integration:

Screenshot 2024-10-03 08 36 38

Same result in the Entities list:

image

Workaround is to switch the system language to English as well and restart HA. But this obviously not the expected behavior as it does not support user accounts with different languages on the same system.

As written above this is not specific to the Sun integration, that's just the most basic one I found to reproduce the issue. It is much more annoying in integrations like Matter, WLED, Xiaomi-Miio where you have tons of different device type specific entity names. There you often need to switch to English and back to verify the current translation, especially when you are a localizer working on those.

What version of Home Assistant Core has the issue?

core-2024.10.0

What was the last working version of Home Assistant Core?

n/a

In which browser are you experiencing the issue with?

n/a

Which operating system are you using to run this browser?

n/a

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

jbouwh commented 3 weeks ago

May be this issue is also related: https://github.com/home-assistant/core/issues/128136 The updated names are shown correctly after Home Assistant is restarted.