commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: [Math] Method "getMessage(Locale loc)" in "MathIllegalArgumentException"
Date Tue, 03 Aug 2010 14:46:54 GMT

----- "Gilles Sadowski" <> a écrit :

> Hi.
> This method:
> ---CUT---
>   public String getMessage(final Locale locale) {
>     // ...
>   }
> ---CUT---
> was added in "MathIllegalArgumentException".
> I don't like it because it extends the Java standard interface for
> getting
> localized message strings. One should use the standard
>   getLocalizedMessage()
> when the localized message is wanted.
> The above method makes it look like CM is providing ways to make a
> "patchwork" of messages in several languages at the discretion of the
> component builders.

More precisely it allows to choose the display language at run time and even to change it
at run time.
It is the explicit goal of this method.
The use case for that is a web application running on a server. Several different users may
connect to it and have different languages settings (one french user and one english user
for example). The messages should be tailored for all these users. The proper settings is
retrieved from the HTTP protocol.

> Only the application developer should be able to
> define
> the language to use for displaying message.

No. It's a user setting.


> Gilles
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message