On 9/11/08, Justice Utete <[EMAIL PROTECTED]> wrote:
> I'm having problems with cocoon internationalisation.
> The following are snippets of my code:
> Portion of the sitemap:
> <map:transformers default="xslt">
> <map:transformer name="i18n"
> logger="sitemap.transformer.i18n"
> src="org.apache.cocoon.transformation.I18nTransformer">
> <catalogues default="messages">
> <catalogue id="messages" name="messages"
> location="actions/translations"/>
> </catalogues>
> <cache-at-startup>true</cache-at-startup>
> <untranslated-text>untranslated
> text!</untranslated-text>
> </map:transformer>
> </map:transformers>
>
> Note: actions/translations is in the same folder as the sitemap
>
> .. and then the pipeline for the page:
>
> <map:match pattern="*.htm">
> <map:generate type="UserRequest"/>
> <map:transform src="{1}.xsl"/>
> <map:transform type="i18n">
> <map:parameter name="locale" value="{locale}"/>
> </map:transform>
> <map:serialize type="html"/>
> </map:match>
>
> The xsl page to be transformed has the following:
> <i18n:text>key1</i18n:text>
>
> and in my messages xml file I have:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <catalogue xml:lang="en">
> <message key="key1">Message for Key 1</message>
> <message key="key2">Message for Key 2 </message>
> </catalogue>
>
> However when i access the page it displays "key1" instead of the value for
> key1 which is "Message for Key 1".
> Whats is the problem with the above?
>
> Regards,
> Justice
Which version of Cocoon?
What is the value of {locale}? (Test as a parameter to the XSLT and
display on the page.)
Cocoon-2.1 does not have an InputModule named "locale". Use the request:
<map:transform type="i18n">
<map:parameter name="locale" value="{request:locale}"/>
</map:transform>
I have yet to find a list of InputModules provided with Cocoon-2.2.
HTH,
solprovider
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]