On 10 Apr 2004, at 13:48, Joerg Heinicke wrote:
On 10.04.2004 12:13, Jeremy Quinn wrote:
Now using the i18n transformer afterwards everything should go on as normal. Hopefully the feature was not added between your Woody version and the recent CForms version.Was this a recent addition ?
Not that I'm aware of. I only wrote it as I did not want to write just "works for me", for the case you already tested it more intensively.
It works now ;)
var i18nLabel = new Packages.org.apache.cocoon.forms.util.I18nMessage("key");
selectionlist[0] = {value: SimpleDescriptor.NO_VALUE, label: i18nLabel};Ah Ha !!!! That looks like it would work !!
I hope so and would be interested if it does.
works beautifully :
importClass (Packages.org.apache.cocoon.woody.util.I18nMessage);
function getSelectionList (session, classname) {
var list = SimpleDescriptorPeer.selectionlist (session, classname);
var selectionlist = new Array (list.size () +1);
selectionlist[0] =
{ value: SimpleDescriptor.NO_VALUE, label: new I18nMessage ("upload.choose.one", "local") };
for (var i = 0; i < list.size (); i++)
selectionlist[i+1] = { value: list.get (i).getId (), label: list.get (i).getName () };
return selectionlist;
}
We have several situations where it would be useful to be able to use Package references to static properties from i18n keys or woody model declarations.
eg.
<wd:range min="#{Packages.blah.SimpleDescriptor.MIN_VALUE}">
or
<message key="search.#{Packages.blah.Query.EQUALS_MATCH}.match">exactly matches</message>
as this saves you keeping declarations of the same value synchronised between display and backend.
I suppose I could turn all of my i18n message files and woody models into JX Templates, but I am not fond of the idea.
That's not my part :) Though it sounds interesting. Personally I would not like to have the functionality doubled from JXTemplate to I18n, but would prefer a cocoon:/ internal pipeline catalogue. Caching is important then of course.
Not sure you can do that because of the negotiation down the locale tree done by the catalogue loader.
I can probably solve this stuff by being smarter in my JX Templates, and maybe begin to generate woody models via JXTemplate too.
Thanks
regards Jeremy
smime.p7s
Description: S/MIME cryptographic signature
