Translation updates

Remove special handling for User Guides, add special handling for
firstapp.

Change-Id: If7b942c5e4a018f33ab89c32e64702a14004afb5
Depends-On: Ib6c9f35e336ee13b84030a6e7164dea27d621e67
This commit is contained in:
Andreas Jaeger 2015-05-13 19:55:57 +02:00
parent 552c693585
commit 4c9922b278
1 changed files with 27 additions and 29 deletions

View File

@ -43,45 +43,43 @@ function build_rst {
# uses SitePackages=True and we have to install Sphinx in the venv # uses SitePackages=True and we have to install Sphinx in the venv
# together with openstackdocstheme. With SitePackages, the global Sphinx # together with openstackdocstheme. With SitePackages, the global Sphinx
# is used and that will not work with a local openstackdocstheme installed. # is used and that will not work with a local openstackdocstheme installed.
if [ ${book} == "user-guide" ] ; then TAG=""
TAG="-t user_only" # We need to extract all strings, so add all supported tags
if [ ${book} = "firstapp" ] ; then
TAG="-t libcloud -t fog"
fi fi
if [ ${book} == "user-guide-admin" ] ; then tox -evenv "sphinx-build -W -b gettext $TAG ${DOC_DIR}${book}/source/ ${DOC_DIR}${book}/source/locale/"
TAG="-t admin_only"
fi
tox -evenv "sphinx-build -W -b gettext $TAG doc/${book}/source/ doc/${book}/source/locale/"
# Now run msgmerge on all files # Now run msgmerge on all files
for f in ${DOC_DIR}${book}/source/locale/*.pot ; do
for f in doc/${book}/source/locale/*.pot ; do
# Skip the master file # Skip the master file
if [ $f == "doc/${book}/source/locale/${book}.pot" ] ; then if [ $f = "${DOC_DIR}${book}/source/locale/${book}.pot" ] ; then
continue continue
fi fi
bf=$(basename $f) bf=$(basename $f)
# Remove .pot # Remove .pot
bfname=${bf%.pot} bfname=${bf%.pot}
msgmerge -o doc/${book}/source/locale/${language}/LC_MESSAGES/${bfname}.po \ msgmerge -o ${DOC_DIR}${book}/source/locale/${language}/LC_MESSAGES/${bfname}.po \
doc/${book}/source/locale/${language}/LC_MESSAGES/${book}.po \ ${DOC_DIR}${book}/source/locale/${language}/LC_MESSAGES/${book}.po \
doc/${book}/source/locale/${bf} ${DOC_DIR}${book}/source/locale/${bf}
msgfmt doc/${book}/source/locale/${language}/LC_MESSAGES/${bfname}.po \ msgfmt ${DOC_DIR}${book}/source/locale/${language}/LC_MESSAGES/${bfname}.po \
-o doc/${book}/source/locale/${language}/LC_MESSAGES/${bfname}.mo -o ${DOC_DIR}${book}/source/locale/${language}/LC_MESSAGES/${bfname}.mo
done done
if [ ${book} == "user-guides" ] ; then if [ ${book} = "firstapp" ] ; then
tox -evenv "sphinx-build -t user_only -D language=${language} \ tox -evenv "sphinx-build -t fog -D language=${language} \
doc/${book}/source/ \ ${DOC_DIR}${book}/source/ \
doc/${book}/build/html" ${DOC_DIR}${book}/build-fog/html"
mkdir -p publish-docs/${language}/user-guide/ mkdir -p publish-docs/${language}/firstapp-fog
rsync -a doc/user-guides/build/html/ publish-docs/${language}/user-guide/ rsync -a ${DOC_DIR}firstapp/build-fog/html/ publish-docs/${language}/firstapp-fog
tox -evenv "sphinx-build -t admin_only -D language=${language} \ tox -evenv "sphinx-build -t libcloud -D language=${language} \
doc/${book}/source/ \ ${DOC_DIR}${book}/source/ \
doc/${book}/build-admin/html" ${DOC_DIR}${book}/build-libcloud/html"
mkdir -p publish-docs/${language}/user-guide-admin/ mkdir -p publish-docs/${language}/firstapp-libcloud
rsync -a doc/user-guides/build-admin/html/ publish-docs/${language}/user-guide-admin/ rsync -a ${DOC_DIR}user-guides/build-libcloud/html/ publish-docs/${language}/firstapp-libcloud/
else else
tox -evenv "sphinx-build $TAG -D language=${language} doc/${book}/source/ \ tox -evenv "sphinx-build -D language=${language} ${DOC_DIR}${book}/source/ \
doc/${book}/build/html" ${DOC_DIR}${book}/build/html"
mkdir -p publish-docs/${language}/${book}/ mkdir -p publish-docs/${language}/${book}/
rsync -a doc/${book}/build/html/ publish-docs/${language}/${book}/ rsync -a ${DOC_DIR}${book}/build/html/ publish-docs/${language}/${book}/
fi fi
} }
@ -100,7 +98,7 @@ function test_language {
BUILD_XML=0 BUILD_XML=0
for book in ${BOOKS["$language"]}; do for book in ${BOOKS["$language"]}; do
if [ ${SPECIAL_BOOKS[$book]+_} ] ; then if [ ${SPECIAL_BOOKS[$book]+_} ] ; then
if [ ${SPECIAL_BOOKS[$book]} == "RST" ] ; then if [ ${SPECIAL_BOOKS[$book]} = "RST" ] ; then
echo "Building translated RST book $book for $language" echo "Building translated RST book $book for $language"
build_rst $language $book build_rst $language $book
if [[ $? -eq 0 ]] ; then if [[ $? -eq 0 ]] ; then