cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Linden H van der (MI)" <H.vanderLin...@MI.unimaas.nl>
Subject RE: CForms samples for 2.1.7 - i18n question - update on error
Date Sat, 12 Mar 2005 20:56:19 GMT
Hi,

I've been adding and removing comments in the pipeline below and I found that the weird namespace
is introduced by the i18n transformer. At first I thought it was an invalid locale setting,
but even if I set it to "en-US" the error remains.

Please help!

Bye, Helma



> -----Original Message-----
> From: Linden H van der (MI) [mailto:H.vanderLinden@MI.unimaas.nl] 
> Sent: Saturday, 12 March 2005 21:02
> To: dev@cocoon.apache.org
> Subject: RE: CForms samples for 2.1.7 - i18n question
> 
> 
> Bertrand et Sylvain,
> 
> Right now, no i18n works. In core.log I find lines like:
> 
> INFO    (2005-03-12) 20:24.05:156   [core.i18n-bundles] 
> (/samples/blocks/cssforms/form1.flow) 
> PoolThread-3/XMLResourceBundleFactory: Resource not found: 
> OtherMessages, locale: nl_BE, bundleName: 
> file:/D:/svn/cocoon/build/webapp/samples/blocks/cssforms/messa
> ges/OtherMessages_nl_BE.xml. Exception: 
> org.apache.cocoon.ResourceNotFoundException: Resource not 
> found.: org.apache.excalibur.source.SourceNotFoundException: 
> file:/D:/svn/cocoon/build/webapp/samples/blocks/cssforms/messa
> ges/OtherMessages_nl_BE.xml doesn't exist.
> INFO    (2005-03-12) 20:24.05:812   [core.i18n-bundles] 
> (/samples/blocks/cssforms/form1.flow) 
> PoolThread-3/XMLResourceBundle: Resource update failed. 
> OtherMessages, locale: nl Exception: Resource not found.
> INFO    (2005-03-12) 20:24.49:031   [core.i18n-bundles] 
> (/samples/blocks/cssforms/form1.flow) 
> PoolThread-4/XMLResourceBundle: Resource update failed. 
> OtherMessages, locale: nl Exception: Resource not found.
> INFO    (2005-03-12) 20:25.54:421   [core.i18n-bundles] 
> (/samples/blocks/cssforms/form1.flow) 
> PoolThread-4/XMLResourceBundle: Resource update failed. 
> OtherMessages, locale: nl Exception: Resource not found.
> INFO    (2005-03-12) 20:27.33:968   [core.i18n-bundles] 
> (/samples/blocks/cssforms/form1.flow) 
> PoolThread-4/XMLResourceBundle: Resource update failed. 
> OtherMessages, locale: nl Exception: Resource not found.
> 
> In /samples/blocks/cssforms/messages I have the usual set of 
> messages. IIUC nl_BE should default to nl and en_US should 
> default to FormsMessages.xml.
> 
> Are these messages correct?
> 
> This is my pipeline:
> 
>      <map:match pattern="*-display-pipeline.jx">
>        <map:generate type="jx" src="forms/{1}_template.xml" 
> label="content1"/>
>         <map:transform type="i18n" label="debug1">
>          <map:parameter name="locale" 
> value="{flow-attribute:locale}"/>
>        </map:transform>
>        <map:call resource="simple-page2html" label="debug2">
>          <map:parameter name="file" value="forms/{1}_template.xml"/>
>        </map:call>
>        <map:transform 
> src="resources/forms-samples-styling.xsl" label="debug3"/>
>        <map:transform type="i18n" label="debug4">
>          <map:parameter name="locale" 
> value="{flow-attribute:locale}"/>
>        </map:transform>
>        <map:serialize/>
>      </map:match>
> 
> 
> Right now I get the i18n keys (i.e. 'firstname' instead of 
> 'First Name'). However, the error messages are translated 
> correctly, i.e. the defaults as available in 
> /samples/blocks/forms/messages are translated, while my 
> extended set (cssforms is merely a copy of 
> /samples/blocks/forms) are ignored.
> Since I get the correct language, I assume the first i18n 
> works correctly.
> 
> The second doesn't work, since I introduce a key calendar.alt 
> for calendar image alt attribute and that's still there.
> 
> In the page source I find this:
> 
> email.help
>         <small xmlns:%@$#^@#="%@$#^@#">
> <br>(below in English only)<br>
> </small>
>         And if you do not know what <b>email</b> address is, 
> then well, chances are
>         that you do not have it. However, if you have access 
> to the Internet,
>         you can easily get yourself one!
>         <br>
> 
> Which is the result of:
> 
>       <fd:help>
>          <i18n:text>email.help</i18n:text>
>         <small><br/>(below in English only)<br/></small>
>         And if you do not know what <b>email</b> address is, 
> then well, chances are
>         that you do not have it. However, if you have access 
> to the Internet,
>         you can easily get yourself one!
>         <br/>
> .....
> </fd:help>
> 
> So I suppose I have 2 or 3 problems here:
> 
> 1. my extended messages are not read (I even moved away the 
> original forms directory and restarted Jetty).
> 2. I get that weird namespace (maybe related), this is 
> already present in label="debug3".
> 
> 3. my second i18n doesn't work, which I can't verify due to 
> error 2. :-(
> 
> Bye, Helma
> 
> 
> 
> 
> > -----Original Message-----
> > From: Bertrand Delacretaz [mailto:bdelacretaz@apache.org] 
> > Sent: Saturday, 12 March 2005 20:00
> > To: dev@cocoon.apache.org
> > Subject: Re: CForms samples for 2.1.7 - i18n question
> > 
> > 
> > Le 12 mars 05, à 19:01, Linden H van der (MI) a écrit :
> > 
> > > ...I've managed to get the i18n for the flowscript samples 
> > to work, by
> > > moving around the i18n transformer. However, I haven't 
> succeeded in
> > > properly translating i18n info that is introduced in the
> > > forms-*-styling.xsl files. It seems impossible to add the i18n
> > > transformer a second time...
> > 
> > Why not twice? I think you need to use it twice, IIRC because the 
> > forms-styling stuff eats the i18n namespace:
> > 
> > I've been doing stuff like
> > 
> > <map:generate type="jx" src="template.xml"/>
> > <map:transform type="i18n"/>
> > <map:transform src="form-styling.xsl">
> > <map:transform src="layout.xsl"/>
> > <map:transform type="i18n"/>
> > <map:serialize type="html"/>
> > 
> > -Bertrand
> > 
> 

Mime
View raw message