cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ard Schrijvers" <a.schrijv...@hippo.nl>
Subject RE: Sitemap/Input Module & i18n guru req.
Date Sun, 22 Jan 2006 21:57:12 GMT
In 2.1.8 it seems to me you ca
> 
> 
> You can use input modules in your locations, but they won't 
> work the way 
> you want. The locations are resolved in when the transformer is 
> configured, not in its setup method, so only values that can 
> be resolved 
> at that time can be used.

Don't know which version you're having, but in 2.1.8 at least, it seems you can override default
component wide catalogues by a locale one:

        // give the catalogue variable its value -- first look if it's locally overridden
        // and otherwise use the component-wide defaults.
        String catalogueId = parameters.getParameter(I18N_DEFAULT_CATALOGUE_ID, null);
        if (catalogueId != null) {
            CatalogueInfo catalogueInfo = (CatalogueInfo) catalogues.get(catalogueId);
            if (catalogueInfo == null) {
                throw new ProcessingException("I18nTransformer: '" +
                                              catalogueId +
                                              "' is not an existing catalogue id.");
            }
            catalogue = catalogueInfo;
        } else {
            catalogue = defaultCatalogue;
        }

        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Default catalogue is " + catalogue.getName());
        }
    }

AS


> 
> However, I acheive a similar effect by using 
> location="prefs://catalog1". prefs is my own Source that locates the 
> bundle using values at the time of the request - it returns a 
> systemid 
> that varies depending on request information so a different cached 
> catalog can be used for each request.
> 
> HTH,
> Ralph
> 
> Rob Gregory wrote:
> 
> > 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
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message