mampfes / hacs_waste_collection_schedule

Home Assistant integration framework for (garbage collection) schedules
MIT License
981 stars 632 forks source link

[Bug]: in Sensor.py is the word “days” not localized #2351

Open HLueken opened 1 month ago

HLueken commented 1 month ago

I Have A Problem With:

Sensor configuration

What's Your Problem

Hi, I use home assistant in German. Since in Sensor.py in line 266 the word “days” is not localised, I get something like “Bioabfall in 3 days”. Would it be possible to change this? Would be nice if days is translated to Tage, and in case the value is 1, it should be day/Tag

Source (if relevant)

No response

Logs

No response

Relevant Configuration

No response

Checklist Source Error

Checklist Sensor Error

Required

5ila5 commented 1 month ago

It's not that easy to change this translation while keeping the ability to rename and modify the sensor in such detail. You can do this pretty easy your self by providing a custom value_template.

To translate it to German you can use the value_template (Werte Template) {{ value.types | join(", ") }} in "Tagen" or {{ value.types | join(", ") }} in {{ value.daysTo }} {{ "Tag" if value.daysTo == 1 else "Tagen" }} to show Tag if daysTo == 1

We may provide some default sensors in the future, that will be automatically translated

HLueken commented 1 month ago

Thank you very much for the hint!