Translate common-rst separately
To ease translation, translate common-rst in a separate po file. Since we reuse the file in all RST guides, this needs special handling. common-rst.pot is empty for now, we need the file so that the tools work. Change-Id: I9972e6222d4018b238da9b2b8f4e93e6ebc9e224 Co-Authored-By: KATO Tomoyuki <kato.tomoyuki@jp.fujitsu.com>
This commit is contained in:
@@ -84,3 +84,10 @@ minimum_perc = 75
|
|||||||
source_file = doc/user-guide-admin/source/locale/user-guide-admin.pot
|
source_file = doc/user-guide-admin/source/locale/user-guide-admin.pot
|
||||||
source_lang = en
|
source_lang = en
|
||||||
type = PO
|
type = PO
|
||||||
|
|
||||||
|
[openstack-manuals-i18n.common-rst]
|
||||||
|
file_filter = doc/common-rst/source/locale/<lang>/LC_MESSAGES/common-rst.po
|
||||||
|
minimum_perc = 75
|
||||||
|
source_file = doc/common-rst/source/locale/common-rst.pot
|
||||||
|
source_lang = en
|
||||||
|
type = PO
|
||||||
|
@@ -29,8 +29,9 @@ POM_FILE="doc/pom.xml"
|
|||||||
# Location of doc dir
|
# Location of doc dir
|
||||||
DOC_DIR="doc/"
|
DOC_DIR="doc/"
|
||||||
|
|
||||||
# Books with special handling
|
# Books with special handling.
|
||||||
# Values need to match content in project-config/jenkins/scripts/common_translation_update.sh
|
# Values need to match content in
|
||||||
|
# project-config/jenkins/scripts/common_translation_update.sh
|
||||||
declare -A SPECIAL_BOOKS=(
|
declare -A SPECIAL_BOOKS=(
|
||||||
["user-guide"]="RST"
|
["user-guide"]="RST"
|
||||||
["user-guide-admin"]="RST"
|
["user-guide-admin"]="RST"
|
||||||
@@ -39,4 +40,6 @@ declare -A SPECIAL_BOOKS=(
|
|||||||
["admin-guide-cloud-rst"]="skip"
|
["admin-guide-cloud-rst"]="skip"
|
||||||
# Skip guide while it's moved to RST.
|
# Skip guide while it's moved to RST.
|
||||||
["install-guide-rst"]="skip"
|
["install-guide-rst"]="skip"
|
||||||
|
# This needs special handling, handle it with the RST tools.
|
||||||
|
["common-rst"] = "RST"
|
||||||
)
|
)
|
||||||
|
0
doc/common-rst/source/locale/common-rst.pot
Normal file
0
doc/common-rst/source/locale/common-rst.pot
Normal file
@@ -12,9 +12,6 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
#
|
|
||||||
# Copy files from trunk to named branch and replace all links from
|
|
||||||
# trunk with links to the branch
|
|
||||||
|
|
||||||
DOCNAME=$1
|
DOCNAME=$1
|
||||||
|
|
||||||
@@ -23,13 +20,52 @@ if [ -z "$DOCNAME" ] ; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# We're not doing anything for this directory. But we need to handle
|
||||||
|
# it by this script so that the common-rst.pot file gets registered.
|
||||||
|
if [[ "$DOCNAME" = "common-rst" ]] ; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Build Glossary
|
# Build Glossary
|
||||||
tools/glossary2rst.py doc/common-rst/glossary.rst
|
tools/glossary2rst.py doc/common-rst/glossary.rst
|
||||||
# First remove the old pot file, otherwise the new file will contain
|
# First remove the old pot file, otherwise the new file will contain
|
||||||
# old references
|
# old references
|
||||||
|
|
||||||
rm -f doc/$DOCNAME/source/locale/$DOCNAME.pot
|
rm -f doc/$DOCNAME/source/locale/$DOCNAME.pot
|
||||||
sphinx-build -b gettext doc/$DOCNAME/source/ doc/$DOCNAME/source/locale/
|
sphinx-build -b gettext doc/$DOCNAME/source/ doc/$DOCNAME/source/locale/
|
||||||
|
|
||||||
|
# Update common
|
||||||
|
sed -i -e 's/^"Project-Id-Version: [a-zA-Z0-9\. ]+\\n"$/"Project-Id-Version: \\n"/' \
|
||||||
|
doc/$DOCNAME/source/locale/common.pot
|
||||||
|
# Create the common pot file
|
||||||
|
msgcat --sort-output doc/common-rst/source/locale/common-rst.pot \
|
||||||
|
doc/$DOCNAME/source/locale/common.pot | \
|
||||||
|
sed -e 's/^"Project-Id-Version: [a-zA-Z0-9\. ]+\\n"$/"Project-Id-Version: \\n"/' | \
|
||||||
|
awk '$0 !~ /^\# [a-z0-9]+$/' | awk '$0 !~ /^\# \#-\#-\#-\#-\# /' \
|
||||||
|
> doc/$DOCNAME/source/locale/common-rst.pot
|
||||||
|
mv -f doc/$DOCNAME/source/locale/common-rst.pot doc/common-rst/source/locale/common-rst.pot
|
||||||
|
rm -f doc/$DOCNAME/source/locale/common.pot
|
||||||
|
|
||||||
|
# Simplify metadata
|
||||||
|
rm -f doc/common-rst/source/locale/dummy.po
|
||||||
|
cat << EOF > doc/common-rst/source/locale/dummy.po
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: \n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2015-01-01 01:01+0900\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
EOF
|
||||||
|
msgmerge -N doc/common-rst/source/locale/dummy.po \
|
||||||
|
doc/common-rst/source/locale/common-rst.pot > doc/common-rst/source/locale/tmp.pot
|
||||||
|
mv -f doc/common-rst/source/locale/tmp.pot doc/common-rst/source/locale/common-rst.pot
|
||||||
|
rm -f doc/common-rst/source/locale/dummy.po
|
||||||
|
|
||||||
# Take care of deleting all temporary files so that git add
|
# Take care of deleting all temporary files so that git add
|
||||||
# doc/$DOCNAME/source/locale will only add the single pot file.
|
# doc/$DOCNAME/source/locale will only add the single pot file.
|
||||||
# Remove UUIDs, those are not necessary and change too often
|
# Remove UUIDs, those are not necessary and change too often
|
||||||
|
Reference in New Issue
Block a user