Add script to clean up translations #33802
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Breaking change
Proposed change
Over time we change our
strings.json
file and we often forget to update Lokalise to either rename the keys or delete them. This results in us having stale keys in Lokalise, which we then download and include in our releases. These translations are then sent to the frontend too, where they sit in memory.This script will find all keys that are in the download from Lokalise, which are no longer represented in the base strings file. These keys are removed.
Here is an output when I just ran it. Note that the first key can no longer be found in Lokalise as I had used that key to test.
We could consider including this in our nightly translations bump, but I rather not, because sometimes we do plan on renaming keys.
@bramkragten this might be useful for the frontend too.
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: