[translation] doc generatepot jobs for 3 projects
This commit adds horizon, openstack-ansible, and openstack-helm to test project doc translation generation jobs by adding openstack-ansible and openstack-helm to project translation job and dealing with pot files. Since project doc translation structure is generally divided into multiple directories such as admin, user, install, and contributor, it is a good idea to split into different pot files and manage as different documents in Zanata. Co-Authored-By: Akihiro Motoki <amotoki@gmail.com> Co-Authored-By: Frank Kloeker <f.kloeker@telekom.de> Change-Id: I84a65f375dbd73f52d7b5d88218f92c53b99a2e9 Implements: blueprint project-doc-translation-support
This commit is contained in:
parent
41641949e7
commit
de0fd555aa
|
@ -5135,6 +5135,8 @@
|
|||
description: Repository containing OpenStack repositories
|
||||
- project: openstack/openstack-ansible
|
||||
description: Ansible playbooks for deploying OpenStack.
|
||||
options:
|
||||
- translate
|
||||
- project: openstack/openstack-ansible-apt_package_pinning
|
||||
description: Role apt_package_pinning for OpenStack-Ansible
|
||||
groups:
|
||||
|
@ -5494,6 +5496,8 @@
|
|||
- openstack-helm
|
||||
description: Helm charts for deploying OpenStack on Kubernetes
|
||||
use-storyboard: true
|
||||
options:
|
||||
- translate
|
||||
- project: openstack/openstack-helm-addons
|
||||
use-storyboard: true
|
||||
groups:
|
||||
|
|
|
@ -417,6 +417,51 @@ function extract_messages_django {
|
|||
done
|
||||
}
|
||||
|
||||
# Extract doc messages
|
||||
function extract_messages_doc {
|
||||
# Temporary build folder for gettext
|
||||
mkdir -p doc/build/gettext
|
||||
|
||||
# Extract messages
|
||||
sphinx-build -b gettext doc/source \
|
||||
doc/build/gettext/
|
||||
# Manipulates pot translation sources if needed
|
||||
if [[ -f tools/doc-pot-filter.sh ]]; then
|
||||
tools/doc-pot-filter.sh
|
||||
fi
|
||||
|
||||
# New translation target projects may not have locale folder
|
||||
mkdir -p doc/source/locale
|
||||
|
||||
# Sphinx builds a pot file for each directory and for each file
|
||||
# in the top-level directory.
|
||||
# We keep the directory files and concatenate all top-level files.
|
||||
local has_other=0
|
||||
for f in doc/build/gettext/*.pot; do
|
||||
local fn=$(basename $f .pot)
|
||||
# If a pot file corresponds to a directory, we use the pot file as-is.
|
||||
if [ -d doc/source/$fn ]; then
|
||||
# Remove UUIDs, those are not necessary and change too often
|
||||
msgcat --use-first --sort-by-file $f | \
|
||||
awk '$0 !~ /^\# [a-z0-9]+$/' > doc/source/locale/doc-$fn.pot
|
||||
rm $f
|
||||
else
|
||||
has_other=1
|
||||
fi
|
||||
done
|
||||
|
||||
# We concatenate remaining into a single pot file so that
|
||||
# "git add ${DIRECTORY}/source/locale" will only add a
|
||||
# single pot file for all top-level files.
|
||||
if [ "$has_other" = "1" ]; then
|
||||
# Remove UUIDs, those are not necessary and change too often
|
||||
msgcat --use-first --sort-by-file doc/build/gettext/*.pot | \
|
||||
awk '$0 !~ /^\# [a-z0-9]+$/' > doc/source/locale/doc.pot
|
||||
fi
|
||||
|
||||
rm -rf doc/build/gettext/
|
||||
}
|
||||
|
||||
# Extract releasenotes messages
|
||||
function extract_messages_releasenotes {
|
||||
local keep_workdir=$1
|
||||
|
|
|
@ -114,6 +114,15 @@ case "$PROJECT" in
|
|||
ALL_MODULES="$modulename $ALL_MODULES"
|
||||
done
|
||||
fi
|
||||
# ---- Documentation ----
|
||||
# Let's test this with some repos :)
|
||||
DOC_TARGETS=('horizon' 'openstack-ansible' 'openstack-helm')
|
||||
if [[ -f doc/source/conf.py ]]; then
|
||||
if [[ ${DOC_TARGETS[*]} =~ "$PROJECT" ]]; then
|
||||
extract_messages_doc
|
||||
ALL_MODULES="doc $ALL_MODULES"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
|
@ -11109,6 +11109,7 @@
|
|||
- publish-openstack-sphinx-docs
|
||||
- deploy-guide-jobs
|
||||
- release-notes-jobs
|
||||
- translation-jobs
|
||||
release:
|
||||
jobs:
|
||||
- announce-release
|
||||
|
@ -11722,6 +11723,7 @@
|
|||
templates:
|
||||
- system-required
|
||||
- publish-openstack-sphinx-docs
|
||||
- translation-jobs
|
||||
|
||||
- project:
|
||||
name: openstack/openstack-helm-addons
|
||||
|
|
Loading…
Reference in New Issue