You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Thomas Christensen <tc...@nordija.com> on 2004/04/10 10:06:11 UTC

Re: Localization with application-wide messages

So "org.apache.tapestry.TapestryStrings.properties" is the default place to
put application messages?
field-too-short from the validation classes seems to require these messages
to be in a different properties file. (BaseValidation.getPattern). Where
does TapestryStrings.properties fit in?

Thomas

----- Original Message ----- 
From: "Erik Hatcher" <er...@ehatchersolutions.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Monday, March 29, 2004 10:03 PM
Subject: Re: Localization with application-wide messages


Message parameterization in Tapestry follows the standard Java rules
using MessageFormat with parametric substitution.  For example,
org.apache.tapestry.TapestryStrings.properties contains this:

service-no-parameters=Service {0} requires no service parameters.

There are methods like getMessage that allow you to pass parameters.

So, in short, its all built-in Java mechanisms :)

Erik

On Mar 29, 2004, at 2:00 PM, ford prefect wrote:

> How do you solve the problem of localized messages
> with parameters?
>
> E.g. in some languages a name would be at the
> beginning of a sentence, in some in the middle and in
> some in the end, if the name is a parameter.
>
> For instance, here is how I solved this problem in
> PHP.
>
> echo "Hello, Peter, how are you?";
>
> Became just
>
> echo _HELLO_USER_HOW_ARE_YOU;
>
> then, there is a language file for every language.
>
> e.g.:
>
> define ("_HELLO_USER_HOW_ARE_YOU","Hello, $user, how
> are you?");
>
> or in another language file:
>
> define ("_HELLO_USER_HOW_ARE_YOU","$user, agga
> ugga?");
>
> So, in the PHP code I never need to think about the
> order of parts of sentences or any language specific
> stuff.
>
>
> How would you do that in tapestry?
>
> You can not include parameters in those properties
> files, as the properties are constant.
>
> In Php those define files are also constant, however,
> they are read for every new page and get updated with
> the current user variables.
>
> The problem is, the properties file would need to have
> access to the visit object or something.....
>
>
>
>
>
>
>
>
>
>
>
> Mit schönen Grüßen von Yahoo! Mail - http://mail.yahoo.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org