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

removed translated states from translation files #576

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ChristophCaina
Copy link
Contributor

by removing the states from the translation files, HomeAssistant should use its default translation for binary_states according to their device_class.

Only, if a language is not available in HomeAssistant itself, the state should be default in english.

fix #384

by removing the states from the translation files, HomeAssistant should use its default translation for binary_states according to their device_class.

Only, if a language is not available in HomeAssistant itself, the state should be default in english.
@ChristophCaina
Copy link
Contributor Author

json error will be fixed... sorry ^^

fixed some issues within the json file
@WebSpider
Copy link
Contributor

Have you tested this, and if so, on what version of HA and in which language?

Last time i tried this, it simply did english for all untranslated states.

@ChristophCaina
Copy link
Contributor Author

ChristophCaina commented Jan 17, 2025

I did some tests with single sensors, before I made the changes.
I have now replaced all translation files with the ones I've provided in the PR...

After rebooting, everything looks as expected and is using the default language set in HA

DE
image

FR
image

did you maybe had the state translation still in your english json file?
HA will always use the translation provided by the integration.
If a specific file does not have a translation, but the english one does have, it will use the english translation from the integration.

Only, if there's no translation given at all, it will use its own translations.
Oh - and I am on 2025.1.x - but this should not affect the translation

@WebSpider
Copy link
Contributor

Thanks for testing this, and for sharing your findings. 🙏

I will re-test this myself to see if we can for instance use a per-entity approach, where most are default from HomeAssistant, and some are translated.

@WebSpider WebSpider self-assigned this Jan 17, 2025
@ChristophCaina
Copy link
Contributor Author

Thanks for testing this, and for sharing your findings. 🙏

I will re-test this myself to see if we can for instance use a per-entity approach, where most are default from HomeAssistant, and some are translated.

this should already be given in the current translation files.
I've only removed the translations for binary_sensors and device_tracker.

Anything else that will have multiple states will be done with these translation files - since those are not translated by HA per default.

Copy link
Contributor

@WebSpider WebSpider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested this, and indeed works as intended, except for the device tracker.

Can you fix the merge conflicts as well?

Comment on lines -159 to -164
"name": "Position",
"state": {
"home": "Home",
"not_home": "Away",
"vehicle_in_motion": "Motion detected"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We specifically have this feature for detecting the vehicle is in motion and have this state translated. Please don't remove this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remove sensor state values from translation
2 participants