home-assistant / core Public
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
Rename translations dir for integrations #34494
Conversation
Will use hassfest to rename the current directories and commit that, but if I do that now review will be hard with the 3000 file limit on GitHub, so I'll hold that off until this is done |
homeassistant/helpers/translation.py
Outdated
if is_platform: | ||
filename = f"{parts[0]}.{language}.json" | ||
return str(integration.file_path / ".translations" / filename) | ||
|
||
# If it's a component that is just one file, we don't support translations | ||
# Example custom_components/my_component.py | ||
if integration.file_path.name != domain: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that is_platform
is now always filtered out by this check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything should still work as before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took a look at the tests (which passed) and there are checks there for this.
Breaking change
Not yet, but I will create a followup PR before 0.111 that will be breaking.
For now, if the old directory name is used the user will see a warning.
Proposed change
Rename
.translations
totranslations
to make it easier for users copying custom integrations.Loading translations from the old path is kept with a warning that it will be removed in 0.111
Type of change
Example entry for
configuration.yaml
:# Example configuration.yaml
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale: