Filip - that looks really good work. 

I didn't realise new bindings can be created. I'm surprised that you're
using %d, %s etc rather than the standard {0} {1} ResourceBundle parameters.
To me it would be nicer expressed like this:  (can you overload bindings?)

${message:key(param0,param1,...,paramN)}

The other thing is can the params be the strings from other messages? This
is something I've done a fair amount in JSP & JSTL to reduce duplication of
translated text in properties files.

I'm really not quite sure what "making the message key itself a binding"
would mean or how it would help, sorry if it's obvious but I'm very new to
Tapestry. I'll certainly not be doing it myself any time soon, I'm just
evaluating the framework at the moment.

Thanks,

Andy.


Filip S. Adamsen-2 wrote:
> 
> I've been thinking about adding support for this to the 
> MessageFormatBindingPrefix found on this wiki page: 
> http://wiki.apache.org/tapestry/Tapestry5HowToAddMessageFormatBindingPrefix
> 
> If you take a look at it the code, MessageFormatBindingFactory in 
> particular, you'll see that making the message key itself a binding 
> wouldn't be too difficult. It should probably default to literal to 
> preserve current behaviour, though.
> 
> You can have a go at it yourself or wait a few days for me to do it.
> 
> -Filip
> 
> On 2008-04-02 20:43, Andy Blower wrote:
>> I'm accessing message catalogs using expansion with a prefix. e.g.
>> ${message:this-is-my-key}
>> 
>> 1) Is there a list of prefixes anywhere, or have I got them all now?
>> (literal, prop, message)
>> 
>> 2) Is there a way of accessing a message with a key that's partially
>> generated by another expansion? 
>> e.g. (this doesn't work obviously, but getProductVariant() is implemented
>> in
>> the page class and its output forms the last segment of the message key) 
>> ${message:product-name-${productVariant}}
>> 
>> 3) Also how can you pass arguments to the messages to replace {0}, {1}
>> etc?
>> 
>> Thanks,
>> 
>> Andy.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-Expansions---prefixes-tp16448078p16467347.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to