🚚 Stop copying yaml content when a new language is added #5815
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.
This is a draft PR meant to collect feedback for a solution of issue #5187.
Description of the problem
When a new language is added in Weblate, the prefill add-on copies the English content into the new language yaml files. This means that when the English content changes, we manually need make the change in all language that do not have the content translated. Instead of this, we would like to keep in the yaml files only the content that has actually been translated.
Description of the solution
When the prefill add-on is disabled, Weblate produces empty files and first, and if translations are added, only the translated key-values are present in the yaml file. The current solution adds a new folder content-translation which will contain all files synced from Weblate (which will contain partial solutions and will be 'styled' according to Weblate's preferences) and a script that generates the same files as currently exist in the content folder by merging the missing translation with the base language (which for now is always English).
This is the minimal change that could stop the language coping. However, there are a couple of things to consider:
The next step would be to find a way to keep which keys still have to be translated. I have not found a nice way to store this information in the generated yaml files along with the keys, so I was thinking to either add a separate key-value pair for untranslated values or even put that information into separate files.