Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit of measurement localization #25

Open
SiriosDev opened this issue Sep 19, 2023 · 5 comments
Open

Add unit of measurement localization #25

SiriosDev opened this issue Sep 19, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@SiriosDev
Copy link

the sensor is great in English but in the other languages (currently it/pt) it is inconsistent, I wanted to open a PR but I didn't understand how to do it, I only found the translation files

@caiosweet
Copy link
Owner

That's right. There is no unit of measurement for the number of earthquakes. The only units of measurement are those listed here. For this reason I chose to force a constant in English "quakes" as the unit of measurement. (another word that could be used would be "events")

@SiriosDev
Copy link
Author

is it not possible to create a translation file for the unit of measurement? if Italian use terremoti(or maybe scosse) if English use quakes etc.

@caiosweet
Copy link
Owner

I have no idea, but I can suggest a much quicker way that solves your problem.
Use customize.

Just add something similar (see the code below) to the yaml configuration file, then choose restart and quick restart and you will have the unit of measurement that is inserted in the entity customization (my entity ID is sensor.ingv_earthquakes_casa_status, obviously you will have to use yours if it is different 😄)

homeassistant:
  customize:
    # Add an entry for each entity that you want to overwrite.
    sensor.ingv_earthquakes_casa_status:
      unit_of_measurement: "scosse"

@SiriosDev
Copy link
Author

oh yes, I know, I already did. my intention was to help those who use this extension, making their life easier (specially for newbies)

@caiosweet
Copy link
Owner

I have no idea if it can be done with the translation of the state or just the attributes, I should try when I have more free time.
strings.json
entity state attributes

@caiosweet caiosweet added the enhancement New feature or request label Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants