cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivelin Ivanov" <ive...@apache.org>
Subject Re: XML Forms and i18n
Date Fri, 26 Jul 2002 11:53:53 GMT

I would recommend this too.

Keep the i18n tags in the markup.

Didn't someone recently said he'll contribute and XMLForm/i18n example?

Ivelin


----- Original Message -----
From: "Piroumian Konstantin" <KPiroumian@protek.com>
To: <cocoon-users@xml.apache.org>
Sent: Friday, July 26, 2002 3:18 AM
Subject: RE: XML Forms and i18n


> Just quick suggestion:
>
> Isn't it possible to use markup when you declare violations? E.g.:
> Instead of: "First name <anametag/> <wrapper>should</wrapper> be at
least
4
> characters."
> I18n version:
> <i18n:translate>
> <i18n:text i18n:key="error.firstname.short">
> <i18n:param><anametag/></i18n:param>
> <i18n:translate>
>
> I don't think that generating i18n markup explicitely is a good idea.
>
> --
> Konstantin Piroumian
> kpiroumian@apache.org
>
>
> > -----Original Message-----
> > From: michael_hampel@sonynetservices.com
> > [mailto:michael_hampel@sonynetservices.com]
> > Sent: Friday, July 26, 2002 11:00 AM
> > To: cocoon-users@xml.apache.org
> > Subject: XML Forms and i18n
> >
> >
> > Hello,
> >
> >     I was just trying to change the XMLFormTransformer to add an
> >     <i18n:text> tag, when the Transformer is dealing with violations.
> >     I tried the following in the startElementViolations method:
> >
> >       1.) I tried to add the tag like this:
> >
> >       // render <violation> tag
> >             super.startElement(uri, TAG_VIOLATION, NS_PREFIX + ":" +
> > TAG_VIOLATION, attributes );
> >              // set message
> >        String startInter = "<i18n:text>";
> >         String endInter = "</i18n:text>";
> >             String vm = nextViolation.getMessage();
> >        String result = startInter + vm + endInter;
> >             super.characters( result.toCharArray(), 0,
> > result.length());
> >
> >             super.endElement(uri, TAG_VIOLATION, NS_PREFIX + ":" +
> > TAG_VIOLATION);
> >
> >       2.) and like this:
> >
> >       INTER_PREFIX = "i18n"
> >       TAG_VIOLATION="text"
> >       Here I thought that I could create the i18n tag like the
> > xf:validation tag is created
> >
> >       // render <violation> tag
> >             super.startElement(uri, TAG_VIOLATION, NS_PREFIX + ":" +
> > TAG_VIOLATION, attributes );
> >         AttributesImpl emptyAttributes = new AttributesImpl();
> >         super.startElement(null, null, INTER_PREFIX + ":" + TAG_INTER,
> > emptyAttributes);
> >             String vm = nextViolation.getMessage();
> >             super.characters( vm.toCharArray(), 0, vm.length());
> >         super.endElement(null, null, INTER_PREFIX + ":" + TAG_INTER);
> >             super.endElement(uri, TAG_VIOLATION, NS_PREFIX + ":" +
> > TAG_VIOLATION);
> >
> > Both ways did not work. In the first case I got an error
> > message like this:
> >       <i18n:text>error_message</i18n:text>
> > but it was not translated - so I think that there were no real tags.
> > The second case was ignored completely  - according to the log.
> >
> > Maybe somebody can advise if I do this at the right place, or
> > if I should
> > try somewhere else
> > or how the Transformer works regarding the
> > super.startElement() - if this
> > is the way how
> > to add a new element to the xml or if this is done differently?
> >
> > thanx again for any help,
> >
> > miHam
> >
> >
> > ---------------------------------------------------------------------
> > Please check that your question  has not already been answered in the
> > FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> >
> > To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> > For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
> >
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Mime
View raw message