I think this is starting to get all out of hand and when I suggested this whole thing I didn't think it was going to be crazy like this.  Perhaps the attribute thing is best left to doing it the normal Wicket way.  I think the only thing I really need for i18n in terms of changing attributes is for a button or submit form element and those are easy enough to add in each page. 

I think we need a simple solution which gets the job done for other cases where, for example, you do:

First Name: <input type="text"/>
Last name: <....>
etc.

Currently, I have to add a label in the page/form for every single label I want for a form field, which honestly is kind of a pain.  So, I suggest we add the <wicket:message> tag which has this:

<wicket:message key="myKey">Default Message</wicket:message>

Nice and simple.  I think this will cover most cases where people use i18n and if attribute support is needed people will just have to add it to a component manually in the page code.

Thoughts?

--Andrew

On 11/9/05, Scott Sauyet <[EMAIL PROTECTED]> wrote:
Johan Compagner wrote:
> then call it wicket:message="value=my-key"
>
> so that
>
> <wicket:message key="..">Default Text</wicket:message>
> and
>  <input type="button" value="My Val" wicket:message="value=my-key"/>
>
> uses the same kind of notation.

I can't decide if I like this idea or not.  I like the idea of having as
few separate constructs as possible, but I'm not sure I like using the
same word for a tag name and an attribute name.  And the more I think
about it, the less I think there really needs to be a separate tag in
the first place.  Usually if you have to add a hook for wicket you use
an existing tag, or throw a SPAN around your content and add the
"wicket:id" to that.  Why not do the same with "wicket:message"?  For
example,

     <span wicket:message="my-key">Default Text</span>

But still, should this use the same construct for attribute replacement?
  I'm not certain, especially since there would need to be a slight
difference in syntax, that is,

     <span wicket:message="my-key">... vs
     <input wicket:message="value=my-key" type=.../>

The latter syntax, as I mentioned earlier, leads itself pretty easily to
  internationalizing multiple attributes simultaneously, with a
comma-separated list:

     <input wicket:message="value=my-key, class=another-key..."/>

but there seems no elegant way of combining these with an i18n message
for the body replacement.  Perhaps that could come first in the list, or
we could use a non-text token, as in:

     <p wicket:message="$=greeting, class=greeting-class">Hello.</p>

But something doesn't smell right to me about this.  I think I would
prefer instead:

     <p wicket:message="greeting" wicket:attr="class=greeting-class">...


The other thing to keep in mind if this really does make it into
development is choosing what happens when there is both a wicket:message
and a wicket:id on a single tag -- which comes first?  And if the
component replaces the tag body does it know anything about the i18n?

I'm guessing that these are really questions for the developers' list,
but since the issue was raised here, I guess we can keep the discussion
here.  Does anyone know if most of the core developers keeps up with
this list?  I know that several do, as I see them post regularly, but I
don't know how many active core developers there are.

Cheers,

   -- Scott Sauyet



-------------------------------------------------------
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