Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HV-416 creating initial documentation module and moving docbook sourc…
…es into new module
- Loading branch information
1 parent
3b2eb1b
commit 66c1e78
Showing
52 changed files
with
278 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Hibernate, Relational Persistence for Idiomatic Java | ||
~ | ||
~ Copyright (c) 2010, Red Hat, Inc. and/or its affiliates or third-party contributors as | ||
~ indicated by the @author tags or express copyright attribution | ||
~ statements applied by the authors. All third-party contributions are | ||
~ distributed under license by Red Hat, Inc. | ||
~ | ||
~ This copyrighted material is made available to anyone wishing to use, modify, | ||
~ copy, or redistribute it subject to the terms and conditions of the GNU | ||
~ Lesser General Public License, as published by the Free Software Foundation. | ||
~ | ||
~ This program is distributed in the hope that it will be useful, | ||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License | ||
~ for more details. | ||
~ | ||
~ You should have received a copy of the GNU Lesser General Public License | ||
~ along with this distribution; if not, write to: | ||
~ Free Software Foundation, Inc. | ||
~ 51 Franklin Street, Fifth Floor | ||
~ Boston, MA 02110-1301 USA | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<artifactId>hibernate-validator-parent</artifactId> | ||
<groupId>org.hibernate</groupId> | ||
<version>4.3.0-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>hibernate-validator-documentation</artifactId> | ||
<packaging>jdocbook</packaging> | ||
|
||
<name>Hibernate Validator Manual</name> | ||
<description>The Hibernate Validator reference manual</description> | ||
|
||
<properties> | ||
<jdocbookSourceDirectory>${basedir}/src/main/docbook</jdocbookSourceDirectory> | ||
<!-- Skip artifact deployment --> | ||
<maven.deploy.skip>true</maven.deploy.skip> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.jboss.maven.plugins</groupId> | ||
<artifactId>maven-jdocbook-plugin</artifactId> | ||
<configuration> | ||
<sourceDirectory>${jdocbookSourceDirectory}</sourceDirectory> | ||
<sourceDocumentName>master.xml</sourceDocumentName> | ||
<masterTranslation>en-US</masterTranslation> | ||
<translations> | ||
<translation>zh-CN</translation> | ||
</translations> | ||
<imageResource> | ||
<directory>${basedir}/src/main/docbook/en-US/images</directory> | ||
</imageResource> | ||
<formats> | ||
<format> | ||
<formatName>pdf</formatName> | ||
<stylesheetResource>classpath:/xslt/org/hibernate/jdocbook/xslt/pdf.xsl | ||
</stylesheetResource> | ||
<finalName>hibernate_validator_reference.pdf</finalName> | ||
</format> | ||
<format> | ||
<formatName>html_single</formatName> | ||
<stylesheetResource>classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml-single.xsl | ||
</stylesheetResource> | ||
<finalName>index.html</finalName> | ||
</format> | ||
<format> | ||
<formatName>html</formatName> | ||
<stylesheetResource>classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml.xsl | ||
</stylesheetResource> | ||
<finalName>index.html</finalName> | ||
</format> | ||
</formats> | ||
<options> | ||
<xincludeSupported>true</xincludeSupported> | ||
<xmlTransformerType>saxon</xmlTransformerType> | ||
<!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme --> | ||
<!-- could also locate the docbook dependency and inspect its version... --> | ||
<docbookVersion>1.72.0</docbookVersion> | ||
<localeSeparator>-</localeSeparator> | ||
</options> | ||
<profiling> | ||
<enabled>true</enabled> | ||
</profiling> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<!-- | ||
here we are attaching the translate goal so that the translations are processed | ||
before compilation so that the translated XML is also transformed during | ||
generation | ||
--> | ||
<phase>process-resources</phase> | ||
<goals> | ||
<goal>translate</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.zanata</groupId> | ||
<artifactId>zanata-maven-plugin</artifactId> | ||
<version>1.3</version> | ||
<configuration> | ||
<srcDir>${basedir}/src/main/docbook</srcDir> | ||
<srcDirPot>${basedir}/src/main/docbook/pot</srcDirPot> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
#!/bin/sh | ||
|
||
# zanata.sh | ||
# | ||
# Script for pushing and pulling translation files to and from Zanata server | ||
|
||
set -eu | ||
|
||
push ( ) | ||
{ | ||
PUSH_PO_FILES=0 | ||
while getopts "a" option | ||
do | ||
case $option in | ||
a ) PUSH_PO_FILES=1;; | ||
* ) usage;; | ||
esac | ||
done | ||
|
||
# update pot files before importing to zanata | ||
echo "Updating POT files" | ||
mvn jdocbook:update-pot | ||
if [ $PUSH_PO_FILES -gt 0 ]; then | ||
echo "Updating PO files" | ||
mvn jdocbook:update-po | ||
fi | ||
|
||
# push updated pot files to zanata for translation | ||
echo "Pushing updated POT files to Zanata for translation" | ||
PUSH_OPTION="" | ||
if [ $PUSH_PO_FILES -gt 0 ]; then | ||
PUSH_OPTION="-Dzanata.importPo" | ||
fi | ||
mvn zanata:publican-push $PUSH_OPTION -e | ||
|
||
echo "Finished! You may want to check pot into version control to track the updated POT files" | ||
} | ||
|
||
pull ( ) | ||
{ | ||
echo "Pulling latest translations from Zanata server" | ||
mvn zanata:publican-pull -e -Dzanata.dstDir=src/main/docbook | ||
echo "Finished! Don't forget to check locale dirs into version control to record the updated PO files" | ||
} | ||
|
||
draft ( ) | ||
{ | ||
DRAFT_DIR="target/draft" | ||
while getopts "d:" option | ||
do | ||
case $option in | ||
d ) DRAFT_DIR=$OPTARG;; | ||
* ) usage;; | ||
esac | ||
done | ||
|
||
# PO files are saved to a directory outside the locale dirs | ||
# to avoid overwriting versioned files. | ||
|
||
mkdir -p $DRAFT_DIR | ||
|
||
echo "Pulling latest translations from Zanata server" | ||
# write PO files to a different directory under target | ||
mvn zanata:publican-pull -e -Dzanata.dstDir=$DRAFT_DIR | ||
|
||
# draft build the translated documents | ||
|
||
# copy en-US source to draft dir for use by jDocBook | ||
cp -a ./src/main/docbook/en-US $DRAFT_DIR/en-US | ||
|
||
echo "Building translated documentation with jDocBook" | ||
|
||
# pick up PO files from the different directory above | ||
mvn jdocbook:resources jdocbook:translate jdocbook:generate -DjdocbookSourceDirectory=$DRAFT_DIR | ||
|
||
echo "Finished!" | ||
} | ||
|
||
usage ( ) | ||
{ | ||
echo "Usage: `basename $0` <command> [<cmd-options>]" | ||
echo "where <command> is one of:" | ||
echo " push : Import updated source content from git to Zanata." | ||
echo " [-a] Update and push translations as well" | ||
echo " pull : Export translations from Zanata to git" | ||
echo " draft : Build DocBook document using latest translations" | ||
echo " [-d draftdir] Directory in which to build the draft documentation" | ||
exit $E_OPTERROR | ||
} | ||
|
||
NO_ARGS=0 | ||
E_OPTERROR=85 | ||
|
||
if [ $# -eq "$NO_ARGS" ] # Script invoked with no command-line args? | ||
then | ||
usage | ||
fi | ||
|
||
command=$1 | ||
shift | ||
|
||
case $command in | ||
"push" ) if [ $# -eq "$NO_ARGS" ] | ||
then | ||
push | ||
else | ||
push "${@}" | ||
fi;; | ||
"pull" ) pull;; | ||
"draft" ) if [ $# -eq "$NO_ARGS" ] | ||
then | ||
draft | ||
else | ||
draft "${@}" | ||
fi;; | ||
* ) usage;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<config xmlns="http://zanata.org/namespace/config/"> | ||
<url>https://translate.jboss.org/</url> | ||
<project>hibernate_search</project> | ||
<project-version>4.2.0</project-version> | ||
<locales> | ||
<locale map-from="de-DE">de</locale> | ||
<locale map-from="es-ES">es</locale> | ||
<locale map-from="fr-FR">fr</locale> | ||
<locale map-from="it-IT">it</locale> | ||
<locale map-from="ja-JP">ja</locale> | ||
<locale map-from="ko-KR">ko</locale> | ||
<locale>pt-BR</locale> | ||
<locale map-from="zh-CN">zh-Hans</locale> | ||
<locale map-from="zh-TW">zh-Hant</locale> | ||
</locales> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters