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
167 lines
5.2 KiB
XML
167 lines
5.2 KiB
XML
<?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>
|