leeyuentuen / polestar_api

Polestar Api - Home Assistant Component
MIT License
112 stars 18 forks source link

Polestar API UI not localised #70

Closed m0wlheld closed 5 months ago

m0wlheld commented 6 months ago

Hi,

my HA instance's UI is set to German / Germany. However, even since there is a German translation available, entity labels and state values are not displayed in German (see screenshot below).

I am using HA Container installation and the Polestar API is manually installed as a custom component. It's the only custom component I use, so I don't know if HACS is required to apply the correct language.

grafik

leeyuentuen commented 6 months ago

strange that it is broken. need to investigate the reason for it. I thought it has work before.

m0wlheld commented 6 months ago

Please not: I am not using HACS but polestar_api as a custom component. Basically I copy custom_components/polestar_api to $HA_HOME/config/custom_components/.

leeyuentuen commented 6 months ago

Please not: I am not using HACS but polestar_api as a custom component. Basically I copy custom_components/polestar_api to $HA_HOME/config/custom_components/.

yes i know, i test yesterday on development and it seems the same issue

ohaue commented 6 months ago

I have the same issue, but the translation works when setting up the integration:

image
leeyuentuen commented 6 months ago

i'll take a look in the next days.

leeyuentuen commented 5 months ago

@ohaue @m0wlheld can you take a look at this beta: https://github.com/leeyuentuen/polestar_api/releases/tag/1.5.4

I've tested on dutch and French (not all are translated yet) image image image

ohaue commented 5 months ago

Seems to be working for most entities now. I have 5 entities - not translated (marked with red) but I can see that is because the entity names in my translation does not match :-)

image
m0wlheld commented 5 months ago

Works for German, with the exception of the 5 entity names from the comment above.

leeyuentuen commented 5 months ago

Works for German, with the exception of the 5 entity names from the comment above.

it isn't translate due change of The native_unit_measurement. maybe i can fix all of them with find and replace

ohaue commented 5 months ago

I fixed the Danish translation and made a PR

leeyuentuen commented 5 months ago

I fixed the Danish translation and made a PR

seems your branch is outdated, i can't merge them right now. i'll check the PR later

m0wlheld commented 5 months ago

The concept of being unit-agnostic hits a limit, when it comes to localising "Odometer". Most of the world uses the metric system, so the translation for German is "Kilometerstand" or "Kilometerzähler". The equivalent would probably be "Milage" in the US and other countries using imperial units. However, since users a free to display the value using m,km or mil, this could lead to weird combinations.

Maybe it's better to leave it at "Odometer", user can override it locally using the entity settings dialog.