cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steinar Jonsson <sjons...@online.no>
Subject Re: CForms, double-listbox and i18n.
Date Sun, 15 Jan 2006 23:02:43 GMT
On Sunday 15 January 2006 23:05, Jason Johnston wrote:
> Steinar Jonsson wrote:
> >>>        SelectableWidget widget =
> >>>(SelectableWidget)form.getChild(widgetName);
> >>>widget.setSelectionList(listOfLabelAndValuePairs, "value", "label");
> >>
> >>I believe that if the value of the "label" path is a
> >>org.apache.cocoon.forms.util.I18nMessage (see the javadocs) then it will
> >>write out the label surrounded by the appropriate i18n tags.
> >
> > I may be wrong, but I somehow got the impression that would only work
> > if the entire label text is an i18n key. In my case each label typically
> > has a prefix part that should be translated and a name part that should
> > not.
>
> You are correct for basic form of I18nMessage.  However it also provides
> special constructors for passing parameters.  So you could pass the
> parts that shouldn't be translated as parameters which would get
> substituted into the final string.
>
> String[] params = {"Jason", "Steinar"};
> I18nMessage msg = new I18nMessage("Message_Key", params);
>
> <message key="Message_Key">{0} hopes this helps {1}.</message>
>

Yes! That looks like exactly what I need! Many thanks!

Steinar, busy writing "read the docs" a hundred times


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


Mime
View raw message