Browse Source

Set the bug project to i18n for the translated docs

Change-Id: Ia86334649990a09c02a379c10adae55594a68c1d
Closes-Bug: #1277544
changes/03/257003/2
KATO Tomoyuki 5 years ago
parent
commit
6f4a9758b5
2 changed files with 21 additions and 0 deletions
  1. +17
    -0
      bin/doc-tools-check-languages
  2. +4
    -0
      releasenotes/notes/i18n-bug-report-b1031955789ee343.yaml

+ 17
- 0
bin/doc-tools-check-languages View File

@ -84,6 +84,20 @@ function build_rst {
-o ${DOC_DIR}${book}/source/locale/${language}/LC_MESSAGES/${bfname}.mo
done
# Set the bug project to I18n project
grep 'bug_project' ${DOC_DIR}${book}/source/conf.py > /dev/null
if [ "$?" -eq 0 ] ; then
# Replace the existing "bug_project" html context
sed -i -e \
's/"bug_project" *: *[^ ,}]*/"bug_project": "openstack-i18n"/' \
${DOC_DIR}${book}/source/conf.py
else
# Add the "bug_project" html context
sed -i -e \
's/html_context *= *{/html_context = {"bug_project": "openstack-i18n", /' \
${DOC_DIR}${book}/source/conf.py
fi
# Build all books
if [ ${book} = "firstapp" ] ; then
# Firstapp has several variations, build all of them
@ -185,6 +199,9 @@ function build_rst {
# Revert changes to po file
git reset -q ${DOC_DIR}${book}/source/locale/${language}/LC_MESSAGES/${book}.po
git checkout -- ${DOC_DIR}${book}/source/locale/${language}/LC_MESSAGES/${book}.po
# Revert changes to conf.py
git reset -q ${DOC_DIR}${book}/source/conf.py
git checkout -- ${DOC_DIR}${book}/source/conf.py
}


+ 4
- 0
releasenotes/notes/i18n-bug-report-b1031955789ee343.yaml View File

@ -0,0 +1,4 @@
---
features:
- Set the bug report project to openstack-i18n
for the translated documents.

Loading…
Cancel
Save