Automate keeping the list of Core pages up-to-date in Weblate
Originally created by @emmapeel on #15191 (Redmine)
To integrate the translation platform on our working system, we need to
automate the
adding of the files in
wiki/src/contribute/l10n_tricks/core_po_files.txt to the list at
https://translate.tails.boum.org/#list-core
from the weblate shell:
from weblate.trans.models import ComponentList
corepages = ComponentList.objects.all()[0]
# Find out if all the core pages are on the core pages component list in weblate
corefiles = open("/var/lib/weblate/repositories/vcs/tails/index/wiki/src/contribute/l10n_tricks/core_po_files.txt", "r")
for page in corefiles.readlines():
compos = corepages.components.filter(filemask__contains=page[2:-2])
if (compos.count() == 0):
page
Gives a list of the lines that cannot be found in the component list in weblate.
Feature Branch: https://salsa.debian.org/hefee/puppet-tails:hefee/update_core_pages