Skip to content

Add update-translations.sh script to fetch translations from weblate

Baptiste Beauplat requested to merge lyknode/debexpo:feat/merge-translation into live

This MR adds the update-translations.sh script.

This script allows to cleanly import weblate translation commit.

It performs the following:

  • Check is the repository is clean
  • Configure the weblate remote
  • Fetch latest commits and create from them two branches translation/update and translation/next
  • Build translation completion statitics and select languages translated over 95%
  • Parse all weblate commit and optimnize them:
    • Check for invalid commits (non language or multi language commit)
    • Drop non selected languages
    • Regroup commit per languages
    • Squashes commit from same author
  • Rebase the optimized translation/update branch
  • Update the AUTHORS file
  • Rebase the translation/next branch on translation/update with the reminder of weblate commits

After the script is run, translation/update is ready to be pushed to salsa for merging into live while translation/next can be used to resolve any conflict on weblate after merging.

On my tests, I managed to get the following optimization:

Out of 591 commits on top of live, 174 where rejected and 417 optimized into 36 commit.

Closes: #153 (closed).

Edited by Baptiste Beauplat

Merge request reports

Loading