Hello,

What about something like that:

Use one of the two forms (both could be allowed):

<wicket:label key="my.msg.key">A text to render</wicket:label>
or
<wicket:label>my.msg.key</wicket:label>

Of course, this introduces a new element in the wicket namespace ...

Or something like that:
<span wicket:type="message" key="my.msg.key">Any text you want</span>
or
<span wicket:id="message_or_whatever" key="my.msg.key">Any text you want</span>

and create a hook in wicket (if it does not already exist) for
resolution classes to handle tags with wicket:type attributes,
or create a hook (if it does not alread exist) for resolution classes
to let them a possibility to handle a markup with no corresponding
component.
Thus creating a resolver which searches for the key attribute ...
More open, but may be like opening the "pandora" box ... ?

Or, as you suggested, using hooks for specific markup modifiers before
or after the wicket component rendering phase ?




On 11/9/05, Juergen Donnerstag <[EMAIL PROTECTED]> wrote:
> I'm all for making things easier for the user.
>
> > Perhaps Wicket could have something like this:
> > <span wicket:id="message:myLabelHere"></span>
>
> I'm not sure this makes sense. wicket:id is not a text to be displayed
> anywhere. It is a name which identifies a component. It definitely
> won't work.
>
> > Even better would be that it would recognize the message:label anywhere in
> > the HTML.  So for example, you could have:
> > <input type="submit" value="message:label.submit" />
>
> That I think is possible. Acutally you can do it today already without
> any changes to the core. You need to develop a IMarkupFilter and
> append it to the list of existing ones invoked by MarkupFilter.
>
> However you won't be able to handle "message: ...." within a tag body;
> only tag attributes. How does Tapestry do it for body text?
>
> An other option would be to run a kind of text based (not xml based)
> pre-processor (like we do merging of inherited markup) prior to adding
> the markup to the cache.
>
> How likely is it that you'll find "message:" and it is not intended to
> be a i18n text? How to escape it?
>
> Lets say your message must contain a reference some other data, e.g.
> "...${price}...". That won't be possible either. Only simple text. As
> AttributeModifier is already able to handle it, "message:.." would be
> for easy and straight forward replacements only, and AttributeModifer
> to cover everything else.
>
> Ah, and of course you loose preview capabilities, as the designer
> won't the real message, he'd see "message:..." only.
>
> And it might not the perfekt solution for high-speed up, because of
> the (little) performance penalties involved. For high-speed up you can
> still have myPage_en.html; myPage_nl.html etc may which as well cover
> minor changes in the layout due to labels being of differents length;
> right-to-left languages etc.
>
> Juergen
>
> On 11/8/05, Andrew Berman <[EMAIL PROTECTED]> wrote:
> > In my app I never hard-code text so I'm constantly adding Labels to my
> > pages.  I was wondering if it would make sense to have a shortcut, similar
> > to how Tapestry does it, for dsplaying localization messages.  In Tapestry,
> > you can do this: title="message:page-title", where page-title is the lookup
> > into the property file.
> >
> > Perhaps Wicket could have something like this:
> > <span wicket:id="message:myLabelHere"></span>
> >
> > Even better would be that it would recognize the message:label anywhere in
> > the HTML.  So for example, you could have:
> > <input type="submit" value="message:label.submit" />
> >
> > Thoughts?
> >
> > --Andrew
> >
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server. Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to