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/messages/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/messages/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:[EMAIL PROTECTED]@#="[EMAIL PROTECTED]@#">
<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:[EMAIL PROTECTED] 
> Sent: Saturday, 12 March 2005 20:00
> To: [email protected]
> 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
> 

Reply via email to