Ok, I got it.

You have to call the i18n transformer right after the form generation step, at least it has to be performed before the forms-samples-styling.xsl transforming.

It does not matter which catalogue contains the messages, as you can specify a catalogue in the i18n transforming step.

The correct position for the forms-samples-styling.xsl is really not easy to find. In the samples it is the last step most of the time. If you (like me) perform this step in an earlier stage of the pipeline be sure to
-do i18n for the form before it
-have the html head tag in your form template, otherwise the forms-samples-styling.xsl won't be able to insert its stylings and js stuff...



Thomas Lutz wrote:

Well, actually I don't have a Forms and a Other catalogue, I have:

<!-- Configure i18n transformer -->
<map:transformer name="i18n" logger="sitemap.transformer.i18n" src="org.apache.cocoon.transformation.I18nTransformer">
       <catalogues default="messages">
<catalogue id="messages" name="messages" location="translations"/>
         <catalogue id="menu" name="menu" location="translations"/>
       </catalogues>
       <cache-at-startup>true</cache-at-startup>
     </map:transformer>

And I put the message in both.

Studying the samples I tried to add a "forms" and a "other" catalogue, too, but :-/.. no luck.

I tried to debug this and what I found is

-the message i pass to the validation error is passed on to a I18NMessage. -if a sax fragment is generated for the later one, it is pre and suffixed by <i18n:text>... which is exactly what it should do -but, somewhere (still have to find this place) the surrounding tags disappear, without translation and error message.. at least nothing you can grep with i18n

Maybe there's some sort of magic string defining the message catalogue... I'll give debugging another try today :-)




footh wrote:

What message catalogue did you put the translated
message in?  I found that when I put the message in
the "Forms" catalogue, the translation didn't work, as
if that catalogue was reserved and couldn't be
changed.  However, when I placed the message in the
"Other" catalogue, it translated fine.  I pulled my
hair out for a while on that one.

--- Thomas Lutz <[EMAIL PROTECTED]> wrote:

Hi list !

I think I am missing something, but I can't figure
out where...

Short :-) description:

I add a ValidationError to a form widget in a custom
binding, this is done via (tErrorMessage is the message key, and yes,
I double checked it exists in my message catalogue :-) ):

((Field) frmModel).setValidationError(new ValidationError(tErrorMessage, true));

The form is displayed using some pipelines. The
first one is a generic html wrapper, that calls the second one.

       <map:match pattern="*.*.html">
         <map:aggregate element="root">
           <map:part src="cocoon:/menu/{0}"/>
           <map:part src="cocoon:/c_{2}/{1}.xml"
element="content" label="content"/>
         </map:aggregate>
         <map:transform

src="context://resources/xsl/html/aim-page2html.xsl">
<map:parameter name="contextPath" value="{request:contextPath}"/>
           <map:parameter name="page" value="{0}"/>
           <map:parameter name="locale"
value="{../locale}"/>
         </map:transform>
         <map:transform type="i18n" />

         <map:serialize type="html"/>
       </map:match>

       <map:match pattern="c_formobj/*.xml">
         <map:generate
src="cocoon:/{1}.obj.form.template.xml"/>
         <map:transform type="forms"
label="content1" />
         <map:transform

src="context://resources/xsl/forms/forms-samples-styling.xsl">
<map:parameter name="resources-uri" value="{request:contextPath}"/>
         </map:transform>

         <map:serialize type="xml"/>
       </map:match>

Everything is ok but the translation of the
errormessage.

I checked the logs with "grep I18n sitemap.log" and
there is no Translation not found, which is the standard message
for not defined messages I think.

What am I missing ? Wrong logfile ? Wrong message
catalogue ? Is this working at all ?

Please help, this one is really driving me crazy :-)
!

thanks,
tom



---------------------------------------------------------------------
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]






____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to