Limych / ha-snowtire

Home Assistant sensor to predict if it's time to change car tires from summer to winter and vice versa.
Other
27 stars 12 forks source link

Feature request: Languages #10

Closed nagyrobi closed 3 years ago

nagyrobi commented 3 years ago

Please add a way to add translations to this component.

Limych commented 3 years ago

It's just a binary sensor. How do you imagine adding translations?

nagyrobi commented 3 years ago

The names. Snowtire, Winter, Summer, these would be nice to appear in my own language, not English.

Limych commented 3 years ago

English are not my own language too. The sensor name — "Snowtire" — is just default value. You are free to set any other sensor name your choose. The sensor, as I said, is binary. It only returns one of two values: "On" or "Off". We cannot change this. The values ​​"Winter" and "Summer" are used only within the "tire_type" attribute. This attribute was added only for the convenience of understanding the main status — its value directly depends on the main status.

The most that can make sense is to translate these two words. But I'm not sure if it's worth doing. Since this will interfere with the visualization of the sensor and will violate the principle of separating the main logic of the sensor and visualization for the user.

From our discussion with you, I, however, had the idea that it is possible to change the values ​​of the sensor states from "On" / "Off" to "Winter" / "Summer". Then the attribute will become unnecessary.

nagyrobi commented 3 years ago

You are free to set any other sensor name your choose.

I am aware that I can chance the py files myself but an update would kill that.

Limych commented 3 years ago

You misunderstood. The name of the sensor is changed through the settings via the “name” field. You do not need to change the component code for this. https://github.com/Limych/ha-snowtire#configuration-variables

nagyrobi commented 3 years ago

Oops sorry I didn't read below the patreon advert. The ​​"Winter" and "Summer" would be nice to be customizable the same way, though. And having these instead of On/Off would be just great.

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.