struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Pratt" <thechrispr...@gmail.com>
Subject Re: Losing Locale after Sesion.invalidate()
Date Fri, 10 Nov 2006 00:22:15 GMT
It's not that I think every application should defalt to English, it's that
I want the default language for MY application to be English.  But to do
that I have to maintain two copies of the same file.  That's bad design.  It
also doesn't appear to understand the concept of layering.  If I ask for a
key that is not in the applications_en.properties file, I would expect it to
automatically check for the key in applications.properties, but that doesn't
appear to be happening.
  (*Chris*)

On 11/9/06, Christopher Schultz <chris@christopherschultz.net> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Chris,
>
> Chris Pratt wrote:
> > The problem is JSTL is being helpful. Perhaps too helpful in this case.
> > Basically it is looking for an exact match between ResourceBundle and
> your
> > Locale settings.
> > It will look for English first, but only find the default resource
> bundle.
> > It will then look for French and find a specific resource bundle for
> French
> > language.
> > Thus JSTL maps itself to the french bundle because it is a more specific
> > match (despite the fact the preferred language is English)
>
> Aah!
>
> That's interesting behavior that is somewhat unexpected in this area
> which is dominated by English-speaking folks. We tend to think that the
> default (non-localized) version of our properties files is (of course!)
> going to be in English. We're pigs.
>
> What is interesting is that most of the time, we expect that the Locale
> will be chosen based upon the user's preferences, and then we try to
> serve them as best we can. The JSTL is, as you say, being extra-helpful
> by finding the "best match" for locale. I wonder if there's a way to
> tell the JSTL what the locale is for the default properties bundles...?
>
> > So I've added an empty application_en.properties file to my project
> > and the problem seems to be closed.
>
> You might also consider using a symlink to point either
> application_en.properties -> application.properties or the other way
> around.
>
> > Thanks for everyone's help.
>
> Always good to get to the botom of a totally weird issue.
>
> - -chris
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD4DBQFFU8TH9CaO5/Lv0PARAl0SAKCCqvWQJsMQScvcqP0nbbU0zwuo3ACXSeUp
> 6Vc00v9ByhqOTZXTTGs/dQ==
> =NrHm
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message