PR: MPXDOC-128
Submitted by: Vincent Siveton Reviewed by: Brett Porter, Arnaud Heritier Internationalization support for xdoc. Applied with changes git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@171222 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
489cf92482
commit
4e177daa2d
49 files changed
+3470
-1027
No files matched your search
+7
-1
@@ -72,8 +72,14 @@ maven.xdoc.poweredby.url = http://maven.apache.org/
|
||||
</question>
|
||||
<answer>Create an index.xml file in the xdocs directory.</answer>
|
||||
</faq>
|
||||
<faq id="i18n">
|
||||
<question>Does the documentation generated by Maven Xdocs plugin support internationalization?</question>
|
||||
<answer>
|
||||
Yes. Please see the <a href="i18n.html">i18n</a> document.
|
||||
</answer>
|
||||
</faq>
|
||||
</part>
|
||||
|
||||
|
||||
<part id="navigation">
|
||||
<title>Navigation</title>
|
||||
|
||||
|
||||
+14
-3
@@ -22,11 +22,11 @@
|
||||
<properties>
|
||||
<title>XDoc Plugin Goals</title>
|
||||
<author email="dion@apache.org">dIon Gillard</author>
|
||||
<author email="vincent.siveton@gmail.com">Vincent Siveton</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<goals>
|
||||
|
||||
<goal>
|
||||
<name>xdoc</name>
|
||||
<description>
|
||||
@@ -49,8 +49,19 @@
|
||||
This goal defines the <code>DVSL</code> tag library for generating
|
||||
documentation. A single tag <code>dvsl:dvsl</code> is defined.
|
||||
</description>
|
||||
</goal>
|
||||
|
||||
</goal>
|
||||
<goal>
|
||||
<name>copy-user-bundles</name>
|
||||
<description>
|
||||
Copy user bundles in the XDOC plugin. Used for the i18n support.
|
||||
</description>
|
||||
</goal>
|
||||
<goal>
|
||||
<name>clean-user-bundles</name>
|
||||
<description>
|
||||
Remove all user bundles from the XDOC plugin.
|
||||
</description>
|
||||
</goal>
|
||||
</goals>
|
||||
</body>
|
||||
</document>
|
||||
@@ -0,0 +1,166 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
/*
|
||||
* Copyright 2001-2005 The Apache Software Foundation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
-->
|
||||
|
||||
<document>
|
||||
<properties>
|
||||
<title>About</title>
|
||||
<author email="vincent.siveton@gmail.com">Vincent Siveton</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<section name="Internationalization">
|
||||
<p>
|
||||
This plugin could produce internationalised Maven1 documentation.
|
||||
</p>
|
||||
</section>
|
||||
<section name="Used Technologies">
|
||||
<p>
|
||||
XDoc plugin uses Java to produce internationalised
|
||||
documentation. Please refer to:
|
||||
<ul>
|
||||
<li>
|
||||
<a href="http://java.sun.com/j2se/corejava/intl/index.jsp">
|
||||
Core Java Internationalization
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/ResourceBundle.html">
|
||||
ResourceBundle (Java 2 Platform SE v1.4.2)
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://java.sun.com/j2se/1.4.2/docs/guide/intl/locale.doc.html">
|
||||
Supported Locales
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://java.sun.com/j2se/1.4.2/docs/guide/intl/encoding.doc.html">
|
||||
Supported Encodings
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
The XDoc plugin will generate this following structure:
|
||||
<source>
|
||||
|-- en\
|
||||
|-- user_dir\
|
||||
|-- index.html
|
||||
|-- ... (mail-lists.html, maven-reports.html...)
|
||||
|-- fr\
|
||||
|-- user_dir\
|
||||
|-- index.html
|
||||
|-- ... (mail-lists.html, maven-reports.html...)
|
||||
|-- OTHER_LANGUAGE\
|
||||
|-- user_dir\
|
||||
|-- index.html
|
||||
|-- ... (mail-lists.html, maven-reports.html...)
|
||||
|-- images\
|
||||
|-- style\
|
||||
|-- user_dir\
|
||||
|-- index.html
|
||||
|-- ... (mail-lists.html, maven-reports.html...)</source>
|
||||
</p>
|
||||
</section>
|
||||
<section name="Getting started">
|
||||
<subsection name="First step">
|
||||
<p>
|
||||
You should define a default locale and all supported locales.
|
||||
For example, you want to produce Maven documentation by
|
||||
default in English, and also in French and in German. Just add
|
||||
these properties in your <code>project.properties</code> file:
|
||||
<div class="source">
|
||||
<pre>
|
||||
maven.xdoc.locale.default=en
|
||||
maven.xdoc.locale.supported=fr, de</pre>
|
||||
</div>
|
||||
</p>
|
||||
</subsection>
|
||||
<subsection name="Second step">
|
||||
<p>
|
||||
You should define your own bundles called
|
||||
<code>${maven.xdoc.bundle}.properties</code>
|
||||
in the
|
||||
<code>${maven.xdoc.bundle.src}</code>
|
||||
directory. In our example, you should have:
|
||||
<div class="source">
|
||||
<pre>
|
||||
|-- ${maven.xdoc.bundle.src}\
|
||||
|-- user_dir\
|
||||
|-- ${maven.xdoc.bundle}.properties
|
||||
|-- ${maven.xdoc.bundle}_fr.properties
|
||||
|-- ${maven.xdoc.bundle}_de.properties
|
||||
</pre>
|
||||
</div>
|
||||
</p>
|
||||
</subsection>
|
||||
<subsection name="Last step">
|
||||
<p>
|
||||
You should create your own XDoc files which supports i18n. For
|
||||
<code>navigation.xml</code> :
|
||||
<source><![CDATA[
|
||||
<menu key="mykey"/>
|
||||
<item key="mykey" href="/mylink.html" />]]></source>
|
||||
For <code>myxdoc.xml</code> :
|
||||
<source><![CDATA[
|
||||
<title key="mykey"/>
|
||||
<message key="mykey"/>
|
||||
<section key="mykey"/>
|
||||
<subsection key="mykey"/>]]></source>
|
||||
|
||||
NOTE: XDoc plugin always uses key if defined. For instance,
|
||||
this line of code:
|
||||
<source><![CDATA[<title key="myKey">blabla</title>]]></source>
|
||||
will produce the key value and not "blabla".
|
||||
|
||||
</p>
|
||||
</subsection>
|
||||
<subsection name="Beautify the generated navigation">
|
||||
<p>
|
||||
If you have lots of languages defined, you can beautify the
|
||||
display with a select form. Just add this following property:
|
||||
|
||||
<div class="source">
|
||||
<pre>maven.xdoc.ui.localeList.asSelect=true</pre>
|
||||
</div>
|
||||
</p>
|
||||
</subsection>
|
||||
</section>
|
||||
<section name="Language supported">
|
||||
<p>
|
||||
Actually, only English, French and German are currently fully
|
||||
supported by Maven. Contributions are welcome!
|
||||
</p>
|
||||
</section>
|
||||
<section name="Known Issues">
|
||||
<subsection name="Generated Reports">
|
||||
<p>
|
||||
All generated reports by other plugins are not supported by the XDoc plugin.
|
||||
Each Maven1 plugin should be translated by their authors.
|
||||
</p>
|
||||
</subsection>
|
||||
<subsection name="Others Plugins">
|
||||
<p>
|
||||
Actually, PDF and HTML2XDOC plugins do not support the
|
||||
internationalization.
|
||||
</p>
|
||||
</subsection>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
@@ -32,6 +32,7 @@
|
||||
<menu name="Overview">
|
||||
<item name="Goals" href="/goals.html"/>
|
||||
<item name="Properties" href="/properties.html"/>
|
||||
<item name="i18n" href="/i18n.html"/>
|
||||
<item name="FAQs" href="/faq.html"/>
|
||||
</menu>
|
||||
</body>
|
||||
|
||||
+83
-18
@@ -18,11 +18,11 @@
|
||||
-->
|
||||
|
||||
<document>
|
||||
|
||||
<properties>
|
||||
<title>Xdoc Properties</title>
|
||||
<author email="smor@apache.org">Stéphane MOR</author>
|
||||
<author email="vmassol@apache.org">Vincent Massol</author>
|
||||
<author email="vincent.siveton@gmail.com">Vincent Siveton</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
@@ -113,6 +113,88 @@
|
||||
</tr>
|
||||
</table>
|
||||
</section>
|
||||
<section name="I18n Properties">
|
||||
<table>
|
||||
<tr>
|
||||
<th>Property name</th>
|
||||
<th>Optional?</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>maven.xdoc.date.format</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
Sets the format of the date to display. Defaults to "dd MMMM
|
||||
yyyy" (eg: "14 August 2002"). For details on the format, see
|
||||
SimpleDateFormat in the jdk documentation.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maven.xdoc.date.locale</td>
|
||||
<td>Yes</td>
|
||||
<td>Sets the locale used for the date. Defaults to "en", ie english.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maven.xdoc.locale.default</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
Sets the default locale used for the translation. If null, it is
|
||||
the default locale for this instance of the Java Virtual Machine
|
||||
Defaults to "en", ie english, to ensure backward compatible.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maven.xdoc.locale.supported</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
A comma separated of locales supported by the project, ie "fr,
|
||||
en_CA"
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maven.xdoc.bundle.src</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
Specifies the location where user bundles are stored. The
|
||||
default value is ${maven.docs.src}.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maven.xdoc.bundle</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
Specifies the name of the user bundles. The default value is
|
||||
xdocs.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maven.xdoc.ui.displayByDefault</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
Boolean value to specify the display of the default language, ie
|
||||
"English [By default]". The default value is false.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maven.xdoc.ui.localeList.asSelect</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
Boolean value to display the language list as an HTML
|
||||
<select/> tag. The default value is false.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maven.xdoc.ui.localeList.max</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
An integer value to specify the maximum number of locales
|
||||
displayes without an HTML <select/> tag. The default value is 5.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</section>
|
||||
<section name="Presentation Properties">
|
||||
<table>
|
||||
<tr>
|
||||
@@ -158,23 +240,6 @@
|
||||
If "maven.xdoc.date" is left empty, no date is shown on the site (default).
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maven.xdoc.date.format</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
Sets the format of the date to display.
|
||||
Defaults to "dd MMMM yyyy" (eg: "14 August 2002").
|
||||
For details on the format, see SimpleDateFormat in the jdk documentation.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maven.xdoc.date.locale</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
Sets the locale used for the date.
|
||||
Defaults to "en", ie english.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maven.xdoc.version</td>
|
||||
<td>Yes</td>
|
||||
|
||||
Reference in new issue
Block a user