-
Notifications
You must be signed in to change notification settings - Fork 289
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
🚚 Stop copying yaml content when a new language is added #5823
Conversation
6c89c8a
to
19cea37
Compare
Added translation using Weblate (Oromo) Added translation using Weblate (Oromo) Added translation using Weblate (Oromo) Added translation using Weblate (Oromo) Added translation using Weblate (Oromo) Added translation using Weblate (Oromo) Added translation using Weblate (Oromo) Added translation using Weblate (Oromo) Added translation using Weblate (Xhosa) Added translation using Weblate (Xhosa) Added translation using Weblate (Xhosa) Added translation using Weblate (Xhosa) Added translation using Weblate (Xhosa) Added translation using Weblate (Xhosa) Added translation using Weblate (Xhosa) Added translation using Weblate (Xhosa) Added translation using Weblate (Xhosa) Co-authored-by: Languages add-on <[email protected]>
Deleted translation using Weblate (Xhosa) Deleted translation using Weblate (Xhosa) Deleted translation using Weblate (Xhosa) Deleted translation using Weblate (Xhosa) Deleted translation using Weblate (Xhosa) Deleted translation using Weblate (Xhosa) Deleted translation using Weblate (Xhosa) Deleted translation using Weblate (Xhosa) Deleted translation using Weblate (Xhosa) Co-authored-by: boryanagoncharenko <[email protected]>
5897d7e
to
f0d8264
Compare
c717ccd
to
1374609
Compare
f0b4bda
to
623b8e8
Compare
a5b5a78
to
7ac4a1c
Compare
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.
Love it! ❤️
Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork). |
Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork). |
Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork). |
b337019
to
9257e9f
Compare
Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork). |
59b4b9a
to
6713f88
Compare
6713f88
to
7b24bad
Compare
Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork). |
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.
Yaml files
All newly added content/yaml files are not prefilled with the current English translation and only contain the translated value for the corresponding language. Currently, only the om language has partial content to illustrate the solution. The content of each yaml file is merged with the en.yaml counterpart when the yaml is loaded.
Po files
Just like the yaml files, all newly added .po files will not be prefilled with English and, again, the om language is used as an example. The merging of every language with English happens through a custom function that defines a fallback. The regular gettext function is substituted with the custom one.
Deduplication of existing languages
The om language is added to this PR for exemplary purposes and is not an officially supported language. Since all current languages have a version of en.yaml files, the merging will not yield immediate results. It will take effect only when a new language is added. Perhaps it is wise to run a basic form of deduplication of the current files and test immediately. Note that complete deduplication of the yaml files is currently very hard to achieve because every yaml file copies a different version of the Enligsh content. However, we could simplify the problem by only removing the duplication that matches the current English version.