Hi JC,
[EMAIL PROTECTED] wrote:
In the explorer, doclisting, properties component. It seems there is a
i18n transformer missing in the explorer sitemap.xmap.
The component Properties based on proplist.xml or, in this case, on the
properties.xml located in the types folder.
Here the default pipeline :
<!--
Get the properties file for a resource
{1} = resource path, e.g. /content/documents/foo.xml
-->
<map:match pattern="properties/**">
<map:aggregate element="root">
<map:part element="propfind" src="cocoon:/propfind-type/{1}"
/>
<map:part element="model" src="{site:model}"/>
</map:aggregate>
<map:transform src="transformers/propform/properties.xsl"/>
<map:transform type="include"/>
<map:serialize type="xml"/>
</map:match>
The properties component (properties.xml in types) :
<Properties xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
<Property>
<Name>comment</Name>
<DisplayName><i18n:text>be.smals.cms.collection.properties.comment
</i18n:text></DisplayName>
<Namespace>http://hippo.nl/cms/1.0</Namespace>
<NamespacePrefix>cms</NamespacePrefix>
<Datatype>string</Datatype>
</Property>
</Properties>
The i18n:text is not translated because there is no i18n transformer.
This pipeline correct it :
<!--
Get the properties file for a resource
{1} = resource path, e.g. /content/documents/foo.xml
-->
<map:match pattern="properties/**">
<map:aggregate element="root">
<map:part element="propfind" src="cocoon:/propfind-type/{1}"
/>
<map:part element="model" src="{site:model}"/>
</map:aggregate>
<map:transform src="transformers/propform/properties.xsl"/>
<map:transform type="include"/>
<!--
** MODIF JECD
**
**
** ADD i18n transform for properties component (explorer)
**
**
**
-->
<map:transform type="i18n">
<map:parameter name="locale" value="{session-attr:locale}"/>
</map:transform>
<map:serialize type="xml"/>
</map:match>
Can you confirm that or I'm on the wrong way ?
That "properties/**" pipeline is normally only used internally from the
sitemap, and the i18n transformation is then done (if necessary) in the
pipeline using it, e.g.
<map:match pattern="proplist2formtemplate/**">
<map:generate src="cocoon:/properties/{1}"/>
<map:transform
src="transformers/propform/proplist2template.xsl">
<map:parameter name="resourceId" value="/{1}"/>
</map:transform>
<map:transform type="i18n">
<map:parameter name="locale" value="{session-attr:locale}"/>
<map:parameter name="default-catalogue-id" value="messages"/>
</map:transform>
<map:serialize type="xml"/>
</map:match>
So adding an i18n transformer to the "properties/**" pipeline would be
redundant.
So if you want to use the "properties/**" pipeline for some other
purpose you need to preserve the i18n tags so you can do the i18n
transformation later on in your own code.
Regards
Niels
********************************************
Hippocms-dev: Hippo CMS development public mailinglist