<?oxygen RNGSchema="../../resources/schemas/page.rng" type="xml"?>
<?oxygen SCHSchema="../../resources/schemas/page.rng"?>
<page:page __file="6fb1a0cf7cb60d784c4bdb2f42955cd9" __status="-1">......</page:page>
<page:page __file="6fb1a0cf7cb60d784c4bdb2f42955cd9" __status="-1" xmlns:i18n="http://apache.org/cocoon/i18n/2.1" xmlns:paloose="http://www.paloose.org/schemas/Paloose/1.0" xmlns:table="http://www.hsfr.org.uk/Schema/Table" xmlns:graphic="http://www.hsfr.org.uk/Schema/Graphic" xmlns:link="http://www.hsfr.org.uk/Schema/Link" xmlns:list="http://www.hsfr.org.uk/Schema/List" xmlns:page="http://www.hsfr.org.uk/Schema/Page" xmlns:t="http://www.hsfr.org.uk/Schema/Text" xmlns:xi="http://www.w3.org/2001/XInclude">
<page:meta>......</page:meta>
<page:meta>
<page:title>Paloose — Multi-language Example</page:title>
<page:copyright>Copyright 2006 – 2017 Hugh Field-Richards. All Rights Reserved.</page:copyright>
</page:meta>
<page:content>......</page:content>
<page:content>
<t:heading level="1">Multi-language Support through I18n</t:heading>
<t:index entry="i18n!examples"/>
<t:index entry="Multi-language Support!examples"/>
<t:index entry="examples!i18n"/>
<t:index entry="examples!Multi-language Support"/>
<t:p>......</t:p>
<t:p>
One of the most useful features of
<t:index entry="Cocoon"/>
Cocoon is its support for multi-language pages. This is done through the i18n transformer (
<t:code type="var">I18nTransformer</t:code>
). See the
<link:link type="uri" ref="/pp/documentation/i18nTransformer.html">documentation page</link:link>
for setting up the sitemap for the I18NTransformer. The translation files are stored in a subdirectory
<t:code type="dir">translations</t:code>
. Look at the code below to see how it all works and the site map.
</t:p>
<list:list type="unordered">......</list:list>
<list:list type="unordered">
<list:item>......</list:item>
<list:item>
<link:link ref="/pp/examples/i18n/i18n-raw.html" target="xml" type="uri">i18n.xml</link:link>
— Contains the raw XML file (this one).
</list:item>
<list:item>......</list:item>
<list:item>
<link:link ref="/pp/examples/i18n/sitemap-raw.html" target="xml" type="uri">sitemap.xmap</link:link>
— Contains the raw XML file (this one).
</list:item>
<list:item>......</list:item>
<list:item>
<t:emph degree="normal">Translations folder</t:emph>
. Contains all the necessary locale/language files.
<list:list type="unordered">......</list:list>
<list:list type="unordered">
<list:item>......</list:item>
<list:item>
<link:link ref="/pp/examples/i18n/translations/i18n-raw.html" target="xml" type="uri">i18n.xml</link:link>
— Default translation file if required one is missing. (Used for all English texts)
</list:item>
<list:item>......</list:item>
<list:item>
<link:link ref="/pp/examples/i18n/translations/i18n_de-raw.html" target="xml" type="uri">i18n_de.xml</link:link>
— Translation file for German.
</list:item>
<list:item>......</list:item>
<list:item>
<link:link ref="/pp/examples/i18n/translations/i18n_fr-raw.html" target="xml" type="uri">i18n_fr.xml</link:link>
— Translation file for French.
</list:item>
</list:list>
</list:item>
</list:list>
<t:p>Select the flags below to change the following text.</t:p>
<t:p>......</t:p>
<t:p>
<link:link type="uri" ref="?locale=en_GB">......</link:link>
<link:link type="uri" ref="?locale=en_GB">
<graphic:graphic ref="resources/images/flag-gb.gif">GB</graphic:graphic>
</link:link>
<link:link type="uri" ref="?locale=en_US">......</link:link>
<link:link type="uri" ref="?locale=en_US">
<graphic:graphic ref="resources/images/flag-us.gif">US</graphic:graphic>
</link:link>
<link:link type="uri" ref="?locale=fr_FR">......</link:link>
<link:link type="uri" ref="?locale=fr_FR">
<graphic:graphic ref="resources/images/flag-fr.gif">Fr</graphic:graphic>
</link:link>
<link:link type="uri" ref="?locale=de_DE">......</link:link>
<link:link type="uri" ref="?locale=de_DE">
<graphic:graphic ref="resources/images/flag-de.gif">De</graphic:graphic>
</link:link>
</t:p>
<list:list type="numbered">......</list:list>
<list:list type="numbered">
<list:item>......</list:item>
<list:item>
<i18n:text>one</i18n:text>
</list:item>
<list:item>......</list:item>
<list:item>
<i18n:text>two</i18n:text>
</list:item>
<list:item>......</list:item>
<list:item>
<i18n:text>three</i18n:text>
</list:item>
<list:item>......</list:item>
<list:item>
<i18n:text>four</i18n:text>
</list:item>
</list:list>
<t:index entry="Paloose!warnings"/>
<t:note type="warning">There seems to be a problem with the date translation on the current public Paloose site server. The code works fine on my local server that I use to build and test the system. I need to speak to my ISP to sort out the build state of the PHP5 that they use.</t:note>
<t:p>......</t:p>
<t:p>
<i18n:date pattern="%A, %e %B %G"/>
</t:p>
<t:p>......</t:p>
<t:p>
<i18n:time pattern="%X (%Z)"/>
</t:p>
</page:content>
</page:page>