diff --git a/gerrit/projects.yaml b/gerrit/projects.yaml index d500f682e6..082f1ff6ac 100755 --- a/gerrit/projects.yaml +++ b/gerrit/projects.yaml @@ -2781,6 +2781,7 @@ description: Community created, open source training guides for OpenStack. options: - direct-release + - translate - project: openstack/training-labs description: Deploy multi node OpenStack on Virtual Machines. - project: openstack/transparency-policy diff --git a/jenkins/jobs/projects.yaml b/jenkins/jobs/projects.yaml index e59f3ae1ad..9a087f1d0a 100644 --- a/jenkins/jobs/projects.yaml +++ b/jenkins/jobs/projects.yaml @@ -6887,6 +6887,7 @@ jobs: - openstack-doc-jobs + - translation-jobs - gate-{name}-tox-{envlist}: envlist: slides diff --git a/jenkins/scripts/common_translation_update.sh b/jenkins/scripts/common_translation_update.sh index 461960d082..8dc89b88ff 100644 --- a/jenkins/scripts/common_translation_update.sh +++ b/jenkins/scripts/common_translation_update.sh @@ -129,6 +129,23 @@ function setup_manuals { -f zanata.xml } +# Setup a training-guides project for Zanata +function setup_training_guides { + local project=$1 + local version=${2:-master} + + # Minimum amount of translation done, 75 % by default. + PERC=75 + + # Update the .pot file + tox -e generatepot-training + + /usr/local/jenkins/slave_scripts/create-zanata-xml.py -p $project \ + -v $version --srcdir doc/upstream-training/locale \ + --txdir doc/upstream-training/locale \ + -f zanata.xml +} + # Setup project so that git review works, sets global variable # COMMIT_MSG. function setup_review { diff --git a/jenkins/scripts/propose_translation_update.sh b/jenkins/scripts/propose_translation_update.sh index 618c6caa3f..c6690d3c4c 100755 --- a/jenkins/scripts/propose_translation_update.sh +++ b/jenkins/scripts/propose_translation_update.sh @@ -59,6 +59,19 @@ function propose_manuals { done } +# Propose updates for training-guides +function propose_training_guides { + + # Pull updated translations from Zanata. + pull_from_zanata "$PROJECT" + + # Compress downloaded po files + compress_po_files "doc/upstream-training" + + # Add all changed files to git + git add doc/upstream-training/locale/* +} + function update_po_files { DIRECTORY=$1 @@ -183,6 +196,10 @@ case "$PROJECT" in setup_manuals "$PROJECT" "$ZANATA_VERSION" propose_manuals ;; + training-guides) + setup_training_guides "$ZANATA_VERSION" + propose_training_guides + ;; django_openstack_auth) setup_django_openstack_auth "$ZANATA_VERSION" propose_django_openstack_auth diff --git a/jenkins/scripts/upstream_translation_update.sh b/jenkins/scripts/upstream_translation_update.sh index 0927d65128..914f431c77 100755 --- a/jenkins/scripts/upstream_translation_update.sh +++ b/jenkins/scripts/upstream_translation_update.sh @@ -37,6 +37,9 @@ case "$PROJECT" in # POT file extraction is done in setup_manuals. setup_manuals "$PROJECT" "$ZANATA_VERSION" ;; + training-guides) + setup_training_guides "$ZANATA_VERSION" + ;; django_openstack_auth) setup_django_openstack_auth "$ZANATA_VERSION" extract_messages diff --git a/zuul/layout.yaml b/zuul/layout.yaml index 09650734f3..6381290021 100644 --- a/zuul/layout.yaml +++ b/zuul/layout.yaml @@ -9263,6 +9263,7 @@ projects: - name: openstack/training-guides template: - name: merge-check + - name: translation-jobs check: - gate-training-guides-tox-doc-publish-checkbuild - gate-training-guides-tox-slides