Skip to content

Commit c9dd190

Browse files
committed
Docs: Adding documentation and translation chapter in dev guide
1 parent 9b691fc commit c9dd190

7 files changed

Lines changed: 332 additions & 0 deletions

docs/en-US/Developers_Guide.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
<xi:include href="whats-new.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
5151
<xi:include href="api-calls.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
5252
<xi:include href="working-with-usage-data.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
53+
<xi:include href="working-with-documentation.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
5354
<xi:include href="tools.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
5455
<xi:include href="event-types.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
5556
<xi:include href="alerts.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version='1.0' encoding='utf-8' ?>
2+
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
3+
<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
4+
%BOOK_ENTITIES;
5+
]>
6+
7+
<!-- Licensed to the Apache Software Foundation (ASF) under one
8+
or more contributor license agreements. See the NOTICE file
9+
distributed with this work for additional information
10+
regarding copyright ownership. The ASF licenses this file
11+
to you under the Apache License, Version 2.0 (the
12+
"License"); you may not use this file except in compliance
13+
with the License. You may obtain a copy of the License at
14+
15+
http://www.apache.org/licenses/LICENSE-2.0
16+
17+
Unless required by applicable law or agreed to in writing,
18+
software distributed under the License is distributed on an
19+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20+
KIND, either express or implied. See the License for the
21+
specific language governing permissions and limitations
22+
under the License.
23+
-->
24+
25+
<section id="building-documentation">
26+
<title>Building &PRODUCT; Documentation</title>
27+
<para>To build a specific guide, go to the source tree of the documentation in /docs and identify the guide you want to build.</para>
28+
<para>Currenlty there are four guides plus the release notes, all defined in publican configuration files:</para>
29+
<programlisting>
30+
publican-adminguide.cfg
31+
publican-devguide.cfg
32+
publican-installation.cfg
33+
publican-plugin-niciranvp.cfg
34+
publican-release-notes.cfg
35+
</programlisting>
36+
<para>To build the Developer guide for example, do the following:</para>
37+
<programlisting>publican build --config=publican-devguide.cfg --formats=pdf --langs=en-US</programlisting>
38+
<para>A pdf file will be created in tmp/en-US/pdf, you may choose to build the guide in a different format like html. In that case just replace the format value.</para>
39+
40+
</section>
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?xml version='1.0' encoding='utf-8' ?>
2+
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
3+
<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
4+
%BOOK_ENTITIES;
5+
]>
6+
7+
<!-- Licensed to the Apache Software Foundation (ASF) under one
8+
or more contributor license agreements. See the NOTICE file
9+
distributed with this work for additional information
10+
regarding copyright ownership. The ASF licenses this file
11+
to you under the Apache License, Version 2.0 (the
12+
"License"); you may not use this file except in compliance
13+
with the License. You may obtain a copy of the License at
14+
15+
http://www.apache.org/licenses/LICENSE-2.0
16+
17+
Unless required by applicable law or agreed to in writing,
18+
software distributed under the License is distributed on an
19+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20+
KIND, either express or implied. See the License for the
21+
specific language governing permissions and limitations
22+
under the License.
23+
-->
24+
25+
<section id="building-translation">
26+
<title>Translating &PRODUCT; Documentation</title>
27+
<para>Now that you know how to build the documentation with Publican, let's move on to building it in different languages. Publican helps us
28+
build the documentation in various languages by using Portable Object Template (POT) files and Portable Objects (PO) files for each language.
29+
</para>
30+
<para>The POT files are generated by parsing all the DocBook files in the language of origin, en-US for us, and creating a long list of strings
31+
for each file that needs to be translated. The translation can be done by hand directly in the PO files of each target language or via the
32+
transifex service.
33+
</para>
34+
<note>
35+
<para><ulink url="http://www.transifex.com">Transifex</ulink> is a free service to help translate documents and organize distributed teams
36+
of translators. Anyone interested in helping with the translation should get an account on Transifex
37+
</para>
38+
<para>
39+
Three &PRODUCT; projects exist on Transifex. It is recommended to tour those projects to become familiar with Transifex:
40+
<itemizedlist>
41+
<listitem><para><ulink url="https://www.transifex.com/projects/p/ACS_DOCS/">https://www.transifex.com/projects/p/ACS_DOCS/</ulink></para></listitem>
42+
<listitem><para><ulink url="https://www.transifex.com/projects/p/ACS_Runbook/">https://www.transifex.com/projects/p/ACS_Runbook/</ulink></para></listitem>
43+
<listitem><para><ulink url="https://www.transifex.com/projects/p/CloudStack_UI/">https://www.transifex.com/projects/p/CloudStackUI/</ulink></para></listitem>
44+
</itemizedlist>
45+
</para>
46+
</note>
47+
<warning>
48+
<para>The pot directory should already exist in the source tree. If you want to build an up to date translation, you might have to update it to include any pot file that was not previously generated.</para>
49+
<para>To register new resources on transifex, you will need to be an admin of the transifex &PRODUCT; site. Send an email to the developer list if you want access.</para>
50+
</warning>
51+
<para>First we need to generate the .pot files for all the DocBook xml files needed for a particular guide. This is well explained at the publican website in a section on
52+
how to <ulink url="http://rlandmann.fedorapeople.org/pug/sect-Users_Guide-Preparing_a_document_for_translation.html">prepare</ulink> a document for translation.</para>
53+
<para>The basic command to execute to build the pot files for the developer guide is:</para>
54+
<programlisting>publican update_pot --config=publican-devguide.cfg</programlisting>
55+
<para>This will create a pot directory with pot files in it, one for each corresponding xml files needed to build the guide. Once genereated, all pots files need to be configured for translation using transifex this is best done by using the transifex client that you can install with the following command (For RHEL and its derivatives):</para>
56+
<programlisting>yum install transifex-client</programlisting>
57+
<para>The transifex client is also available via PyPi and you can install it like this:</para>
58+
<programlisting>easy_install transifex-client</programlisting>
59+
<para>Once you have installed the transifex client you can run the <emphasis>settx.sh</emphasis> script in the <emphasis>docs</emphasis> directory. This will create the <emphasis>.tx/config</emphasis> file used by transifex to push and pull all translation strings.</para>
60+
<para>All the resource files need to be uploaded to transifex, this is done with the transifex client like so:</para>
61+
<programlisting>tx push -s</programlisting>
62+
<para>Once the translators have completed translation of the documentation, the translated strings can be pulled from transifex like so:</para>
63+
<programlisting>tx pull -a</programlisting>
64+
<para>If you wish to push specific resource files or pull specific languages translation strings, you can do so with the transifex client. A complete documentation of
65+
the client is available on the <ulink url="http://help.transifex.com/features/client/">client</ulink> website</para>
66+
<para>When you pull new translation strings a directory will be created corresponding to the language of the translation. This directory will contain PO files that will be used by Publican to create the documentation in that specific language. For example assuming that you pull the French translation whose language code is fr-FR, you will build the documentation with publican:</para>
67+
<programlisting>publican build --config=publican-devguide.cfg --formats=html --langs=fr-FR</programlisting>
68+
<warning>
69+
<para>
70+
Some languages like Chinese or Japanese will not render well in pdf format and html should be used.
71+
</para>
72+
</warning>
73+
<xi:include href="translating-documentation.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
74+
75+
</section>

docs/en-US/installing-publican.xml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version='1.0' encoding='utf-8' ?>
2+
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
3+
<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
4+
%BOOK_ENTITIES;
5+
]>
6+
7+
<!-- Licensed to the Apache Software Foundation (ASF) under one
8+
or more contributor license agreements. See the NOTICE file
9+
distributed with this work for additional information
10+
regarding copyright ownership. The ASF licenses this file
11+
to you under the Apache License, Version 2.0 (the
12+
"License"); you may not use this file except in compliance
13+
with the License. You may obtain a copy of the License at
14+
15+
http://www.apache.org/licenses/LICENSE-2.0
16+
17+
Unless required by applicable law or agreed to in writing,
18+
software distributed under the License is distributed on an
19+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20+
KIND, either express or implied. See the License for the
21+
specific language governing permissions and limitations
22+
under the License.
23+
-->
24+
25+
<section id="installing-publican">
26+
<title>Installing Publican</title>
27+
<para>&PRODUCT; documentation is built using publican. This section describes how to install publican on your own machine so that you can build the documentation guides.</para>
28+
<note>
29+
<para>The &PRODUCT; documentation source code is located under <emphasis>/docs</emphasis></para>
30+
<para>Publican documentation itself is also very <ulink url="http://docs.fedoraproject.org/en-US/Fedora_Contributor_Documentation/1/html/Users_Guide/chap-Users_Guide-Installing_Publican.html">useful</ulink>.</para>
31+
</note>
32+
<para>On RHEL and RHEL derivatives, install publican with the following command:</para>
33+
<programlisting>yum install publican publican-doc</programlisting>
34+
<para>On Ubuntu, install publican with the following command:</para>
35+
<programlisting>apt-get install publican publican-doc</programlisting>
36+
<para>For other distribution refer to the publican documentation listed above. For latest versions of OSX you may have to install from <ulink url="https://fedorahosted.org/publican/wiki/Installing_OSX">source</ulink> and tweak it to your own setup.</para>
37+
<para>Once publican is installed, you need to setup the so-called &PRODUCT; brand defined in the <emphasis>docs/publican-&PRODUCT;</emphasis> directory.</para>
38+
<para>To do so, enter the following commands:</para>
39+
<programlisting>
40+
sudo cp -R publican-cloudstack /usr/share/publican/Common_Content/cloudstack
41+
</programlisting>
42+
<para>If this fails or you later face errors related to the brand files, see the publican <ulink url="http://docs.fedoraproject.org/en-US/Fedora_Contributor_Documentation/1/html/Users_Guide/chap-Users_Guide-Branding.html#sect-Users_Guide-Installing_a_brand">documentation</ulink>.</para>
43+
<para>With publican installed and the &PRODUCT; brand files in place, you should be able to build any documentation guide.</para>
44+
45+
46+
</section>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version='1.0' encoding='utf-8' ?>
2+
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
3+
<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
4+
%BOOK_ENTITIES;
5+
]>
6+
7+
<!-- Licensed to the Apache Software Foundation (ASF) under one
8+
or more contributor license agreements. See the NOTICE file
9+
distributed with this work for additional information
10+
regarding copyright ownership. The ASF licenses this file
11+
to you under the Apache License, Version 2.0 (the
12+
"License"); you may not use this file except in compliance
13+
with the License. You may obtain a copy of the License at
14+
15+
http://www.apache.org/licenses/LICENSE-2.0
16+
17+
Unless required by applicable law or agreed to in writing,
18+
software distributed under the License is distributed on an
19+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20+
KIND, either express or implied. See the License for the
21+
specific language governing permissions and limitations
22+
under the License.
23+
-->
24+
25+
<section id="translating-documentation">
26+
<title>Translating &PRODUCT; Documentation</title>
27+
28+
<para>There are two ways to translate the documentation:</para>
29+
<para>
30+
<itemizedlist>
31+
<listitem><para>Directly using the Transifex website and using their user interface.</para></listitem>
32+
<listitem><para>Using the Transifex client and pushing your translated strings to the website.</para></listitem>
33+
</itemizedlist>
34+
</para>
35+
<para>Once a translation is complete, a site admin will pull the translated strings within the &PRODUCT; repository, build the documenation and publish it.</para>
36+
<para>For instructions on how to use the Transifex website see <ulink url="http://sebgoa.blogspot.ch/2012/11/translating-apache-cloudstack-docs-with.html">http://sebgoa.blogspot.ch/2012/11/translating-apache-cloudstack-docs-with.html</ulink></para>
37+
<para>For instructions on how to use the Transifex client to translate from the command line see <ulink url="http://sebgoa.blogspot.ch/2012/12/using-transifex-client-to-translate.html">http://sebgoa.blogspot.ch/2012/12/using-transifex-client-to-translate.html</ulink></para>
38+
</section>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version='1.0' encoding='utf-8' ?>
2+
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
3+
<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
4+
%BOOK_ENTITIES;
5+
]>
6+
7+
<!-- Licensed to the Apache Software Foundation (ASF) under one
8+
or more contributor license agreements. See the NOTICE file
9+
distributed with this work for additional information
10+
regarding copyright ownership. The ASF licenses this file
11+
to you under the Apache License, Version 2.0 (the
12+
"License"); you may not use this file except in compliance
13+
with the License. You may obtain a copy of the License at
14+
15+
http://www.apache.org/licenses/LICENSE-2.0
16+
17+
Unless required by applicable law or agreed to in writing,
18+
software distributed under the License is distributed on an
19+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20+
KIND, either express or implied. See the License for the
21+
specific language governing permissions and limitations
22+
under the License.
23+
-->
24+
25+
<chapter id="working-with-documentation">
26+
<title>Preparing and Building &PRODUCT; Documentation</title>
27+
<para>This chapter describes how to install publican, how to write new documentation and build a guide as well as how to build a translated version of the documentation using transifex</para>
28+
<xi:include href="installing-publican.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
29+
<xi:include href="building-documentation.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
30+
<xi:include href="writing-new-documentation.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
31+
<xi:include href="building-translation.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
32+
</chapter>

0 commit comments

Comments
 (0)