You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Cyriaque Dupoirieux <Cy...@pcotech.fr> on 2007/10/04 14:15:24 UTC

[Dispatcher] Problem with i18n and pdf

Hi,

    I don't know how to translate the hard coded strings in the
dispatcher fo generation.
    I tried to translate "Table of Content" by adding a translation in
the
org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/translations/CommonMessages_<lang>.xml

    But it does not work...

    An idea ?
-- 
Salutations,
Cyriaque,



Re: [Dispatcher] Problem with i18n and pdf

Posted by Cyriaque Dupoirieux <Cy...@pcotech.fr>.
le 08/10/2007 08:58 Sjur Moshagen a écrit :
> Hi,
>
> Den 4. okt. 2007 kl. 15.15 skrev Cyriaque Dupoirieux:
>
>> Hi,
>>
>>     I don't know how to translate the hard coded strings in the
>> dispatcher fo generation.
>>     I tried to translate "Table of Content" by adding a translation in
>> the
>> org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/translations/CommonMessages_<lang>.xml
>>
>>
>>     But it does not work...
>>
>>     An idea ?
>
> Yes, I have had it working for some time, but had forgot to commit it.
> Unfortunately, when i svn-up-ed before commiting the change, the pdf
> generation broke completely:
>
> Internal Server Error
> ...
> cause
> master-reference 'book' for fo:page-sequence matches no
> simple-page-master or page-sequence-master
Ho ? I have the same problem with one of my numerous files and am
currently also looking at this problem.
If I understand what's my problem, I tell you.

Salutations,
Cyriaque,

>
> I have to solve that one first.
>
> But back to the idea about the original problem:
>
> The issue is caused by there being no i18n processing defined in:
>
> plugins/org.apache.forrest.plugin.output.pdf/output.xmap
>
> Adding i18n to that file should solve it. I will commit the required
> modifications as soon as I get pdf working here again (I would like to
> verify that it works with HEAD before commiting - I haven't updated my
> svn in quite some time).
>
> Best regards,
> Sjur
>
>
>


Re: [Dispatcher] Problem with i18n and pdf

Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
On Mon, 2007-10-08 at 09:58 +0300, Sjur Moshagen wrote:
> Hi,
> 
> Den 4. okt. 2007 kl. 15.15 skrev Cyriaque Dupoirieux:
> 
> > Hi,
> >
> >     I don't know how to translate the hard coded strings in the
> > dispatcher fo generation.
> >     I tried to translate "Table of Content" by adding a translation in
> > the
> > org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/ 
> > common/translations/CommonMessages_<lang>.xml
> >
> >     But it does not work...
> >
> >     An idea ?
> 
> Yes, I have had it working for some time, but had forgot to commit  
> it. Unfortunately, when i svn-up-ed before commiting the change, the  
> pdf generation broke completely:
> 
> Internal Server Error
> ...
> cause
> master-reference 'book' for fo:page-sequence matches no simple-page- 
> master or page-sequence-master
> 
> I have to solve that one first.
> 
> But back to the idea about the original problem:
> 
> The issue is caused by there being no i18n processing defined in:
> 
> plugins/org.apache.forrest.plugin.output.pdf/output.xmap
> 

Yeah, that can be since i18n is enabled for all contracts in the
internal.xmap:

 <map:act type="locale" >
        <map:match pattern="resolve.structurer.**">
          <map:generate src="lm://resolve.structurer.{1}" />
          <map:serialize />
        </map:match>
        <map:match pattern="resolve.contract.*.**">
          <map:generate src="{lm:resolve.contract.{1}.{2}}" />
          <map:transform type="i18n">
            <map:parameter name="locale" value="{../locale}" />
          </map:transform>
          <map:serialize />
        </map:match>
      </map:act>

But maybe we need to explicitly add it as well to:
 <map:match pattern="**.fo">
        <map:generate src="cocoon:/resolve.structurer.{1}" type="jx">
          <map:parameter name="lenient-xpath" value="true" />
          <map:parameter name="getRequest" value="{1}" />
          <map:parameter name="getRequestExtension" value="fo" />
          <map:parameter name="contextPath"
value="{request:contextPath}" />
        </map:generate>
        <map:transform type="dispatcher">
          <map:parameter name="cacheKey" value="{0}" />
          <map:parameter name="validityFile"
value="cocoon:/resolve.structurer.{1}" />
          <map:parameter name="request" value="{1}" />
          <map:parameter name="type" value="fo" />
          <map:parameter name="hooksTransformer"
value="lm://hooks-to-fo.xsl"/>
        </map:transform>
        <map:transform 
          src="lm://strip-dispatcher-remains-fo.xsl" 
          />
        <map:serialize  />
      </map:match>


HTH

salu2

> Adding i18n to that file should solve it. I will commit the required  
> modifications as soon as I get pdf working here again (I would like  
> to verify that it works with HEAD before commiting - I haven't  
> updated my svn in quite some time).
> 
> Best regards,
> Sjur
> 
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


Re: [Dispatcher] Problem with i18n and pdf

Posted by Sjur Moshagen <sj...@mac.com>.
Hi,

Den 4. okt. 2007 kl. 15.15 skrev Cyriaque Dupoirieux:

> Hi,
>
>     I don't know how to translate the hard coded strings in the
> dispatcher fo generation.
>     I tried to translate "Table of Content" by adding a translation in
> the
> org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/ 
> common/translations/CommonMessages_<lang>.xml
>
>     But it does not work...
>
>     An idea ?

Yes, I have had it working for some time, but had forgot to commit  
it. Unfortunately, when i svn-up-ed before commiting the change, the  
pdf generation broke completely:

Internal Server Error
...
cause
master-reference 'book' for fo:page-sequence matches no simple-page- 
master or page-sequence-master

I have to solve that one first.

But back to the idea about the original problem:

The issue is caused by there being no i18n processing defined in:

plugins/org.apache.forrest.plugin.output.pdf/output.xmap

Adding i18n to that file should solve it. I will commit the required  
modifications as soon as I get pdf working here again (I would like  
to verify that it works with HEAD before commiting - I haven't  
updated my svn in quite some time).

Best regards,
Sjur