Search code examples
githubinternationalizationtranslationweblate

Is it possible to filter weblate push per language by completeness rate


General situation

We have a project on GitHub and in hosted.weblate in the libre plan. The weblate project contains 3 components and a glossary.

Two languages are already completely translated and we use the continuous localization workflow.

There are some additional languages from the very kind community. However, these are not complete(d yet), so they cause problems in the front end (like showing no text or the plain string.variable.name).

What should be achieved?

We would like to have the incomplete languages only available after they are complete (at least have no empty strings). So they should be pushed only if either a manual flag is set/removed or at a certain completeness level. Is there a way or best practice on how to deal with that?

Ideas to achieve it (but no idea if this is possible)

An idea would be to only commit changes on languages, that have a certain overall completeness level. For the languages that are completed already we would ideally keep the continuous translation workflow. Also manual commits are problematic, since they would commit also the incomplete languages.

Is there a way to set a flag or achieve a .gitignore like behaviour for certain languages in weblate? When they are not empty anymore, we could of course manually activate the languages.


Solution

  • I've set up a translation project for Syncthing on Hosted Weblate, which was previously handled through Transifex. There was already some tooling in place which respects this completeness filter, and it was pretty easy to adapt to Weblate.

    Basically we don't push Weblate changes back to the upstream repo, but pull them in through a regularly called script, together with some other housekeeping tasks like an authors list. The script checks the statistics on every available language and if the completion is above 95 percent, the language is added to a "valid" list, which the GUI uses to offer choices. Translations previously on that list drop off only if they fall below 75 percent completion.

    In any case, the script downloads the most recent translation files and commits them to the upstream repo for archival reasons. When this happens, Weblate picks up the new commits and rebases its internal repo. That also allows integrating translation contributions from other sources easily.