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

🚚 Stop copying yaml content when a new language is added #5815

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

Conversation

boryanagoncharenko
Copy link
Collaborator

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 content folder will contain some files which are generated and some which are static. This might be confusing.
  • The generated yaml files in the content folder will have different formatting especially the multi-line strings.
  • The yaml files in Weblate will be in content-translate but the .po files in website will be in content because the po files do not need to be merged via this mechanism.

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.

Languages add-on and others added 4 commits September 27, 2024 12:51
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants