cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Gregory" <...@RosesGroup.co.uk>
Subject RE: Sitemap/Input Module & i18n guru req.
Date Sun, 22 Jan 2006 22:18:58 GMT
Thank you AS,

 

Although it's the location of the catalogue I need to be dynamic not the
catalogue name which I still need to use i18n logic to degrade across
country/language/variant etc.

 

The current cocoon i18n transformer allows multiple locations to be
specified which will be searched (using the locale) fist until a match is
found and that is perfect. But to allow me to deploy the translation files
on a per application basis requires me to set this location at runtime? Your
solution suggests the catalogue name can be passed in when pipeline matches?
Can the location of the default catalogue also be passed in?

 

Or are you suggesting I can pass any parameter I like (e.g. <map:paramter
name="hello" value="world {1}"/> and use this some how in the transformer
declaration where catalogues are loaded etc.

 

Many thanks for your help.

Rob

 

  _____  

From: Ard Schrijvers [mailto:a.schrijvers@hippo.nl] 
Sent: 22 January 2006 16:01
To: users@cocoon.apache.org
Subject: RE: Sitemap/Input Module & i18n guru req.

 

Hello Rob, I am not very sure but I think you can do it very easily in your
transformation like:

 

<map:match pattern="foo/bar/*">

    <map:generate .....som stuff

    <map:transform ....

    

    <map:transform type="i18n">

        <map:paramter name="default-catalogue-id" value="i18n/{1}"/>

    </map:transform>

</map:match>

 

You can override the default components settings in the transform itself. 

 

 

AS

 

 



 

Hello Cocoon Supporter; o)

 

I have a problem with i18n support within Cocoon but suspect the issue can
be resolved via the sitemap (which is so flexible) and as such the question
is more of an 'InputModule' usage than a problem with i18n.

 

Basically the i18n support within Cocoon is perfect with the one exception
of the location of the translation files being hard coded as follows:-

 

      <map:transformer name="i18n"
        src="org.apache.cocoon.transformation.I18nTransformer">
        <catalogues default="mymessages">
          <catalogue id="mymessages" name="messages" location="i18n"/>
          <catalogue id="mymessages" name="messages"
location="i18n/alternate"/>        </catalogues>
        <cache-at-startup>true</cache-at-startup>
      </map:transformer>

 

 

I need to replace the hardcoded location to be dynamic depending on the
requested URI

 

For example if the requested uri is rob100_mypage I would need to
dynamically change the location to be 

 

Location="I18n/rob100"  i.e. I need to substring the first 6 characters of
the URI and search this location for i18n catalogues. I presume input
modules can be specified in the transformer declaration but I'm not sure how
to substring the results of the {request:} inputmodule.

 

Any help much appreciated.

 

Thanks in advance

Rob

 


Mime
View raw message