You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by scarter <sc...@tsys.com> on 2003/02/27 21:51:21 UTC
STRUTS INTERNATIONALIZATION
Is there a way in struts to maintain a default application resources
file that can be referred to in the event that a requested resource is
not found in another resource file. For example, it would be nice if I
could only define specific resources in each locale specific resource
file, instead of all of them, which consumes much more memory and more
importantly, makes the application difficult to maintain. The full set
of default application resources could be defined in a default
application resource file that would be called if the resource is not
present in a locale specific one. This is especially important where
two locales are defined, say the US and UK, where very few resource
differences exist. If there are only a handful of resource differences
between these locales, I would not want to have to create an entirely
new resource file for each one, since there would be quite a few
redundancies.
I am aware that we can define separate resource bundles and associate
each one with a bundle name. However the problem with this approach is
that I have to modify all of my struts tags to use statically defined
bundle names. Does anyone know of another way I can resolve this
problem?
Thanks,
Scott Carter
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: STRUTS INTERNATIONALIZATION
Posted by James Prance <Ja...@hotmail.com>.
I agree with Mr Mitchell...
(thats three james' replied to this post.. any more out there)
"scarter" <sc...@tsys.com> wrote in message
news:019a01c2dea1$feb34e60$03fea8c0@DOTSDEV14...
> Is there a way in struts to maintain a default application resources
> file that can be referred to in the event that a requested resource is
> not found in another resource file. For example, it would be nice if I
> could only define specific resources in each locale specific resource
> file, instead of all of them, which consumes much more memory and more
> importantly, makes the application difficult to maintain. The full set
> of default application resources could be defined in a default
> application resource file that would be called if the resource is not
> present in a locale specific one. This is especially important where
> two locales are defined, say the US and UK, where very few resource
> differences exist. If there are only a handful of resource differences
> between these locales, I would not want to have to create an entirely
> new resource file for each one, since there would be quite a few
> redundancies.
>
> I am aware that we can define separate resource bundles and associate
> each one with a bundle name. However the problem with this approach is
> that I have to modify all of my struts tags to use statically defined
> bundle names. Does anyone know of another way I can resolve this
> problem?
>
> Thanks,
>
> Scott Carter
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: STRUTS INTERNATIONALIZATION
Posted by James Mitchell <jm...@apache.org>.
If I undertand you correctly, that's what PropertyMessageResources does.
For example, say you've got a server in France serving international
users
A request comes in and you code looks calls a resource "my.message"
It will look under the current users locale (say UK), it would
recursively look in:
1. ApplicationResources.properties_en_UK
2. ApplicationResources.properties_en
3. ApplicationResources.properties (Struts 'default')
And then finally the server's 'default' locale
4. ApplicationResources.properties_fr
I would say your best bet is to make #3 your base file and add locale
specific messages as you need them.
--
James Mitchell
Web Developer/Struts Evangelist
http://www.microsoft.com/struts/
> -----Original Message-----
> From: scarter [mailto:scarter@tsys.com]
> Sent: Thursday, February 27, 2003 3:51 PM
> To: struts-user@jakarta.apache.org
> Subject: STRUTS INTERNATIONALIZATION
>
>
> Is there a way in struts to maintain a default application resources
> file that can be referred to in the event that a requested resource is
> not found in another resource file. For example, it would be
> nice if I
> could only define specific resources in each locale specific resource
> file, instead of all of them, which consumes much more memory and more
> importantly, makes the application difficult to maintain.
> The full set
> of default application resources could be defined in a default
> application resource file that would be called if the resource is not
> present in a locale specific one. This is especially important where
> two locales are defined, say the US and UK, where very few resource
> differences exist. If there are only a handful of resource
> differences
> between these locales, I would not want to have to create an entirely
> new resource file for each one, since there would be quite a few
> redundancies.
>
> I am aware that we can define separate resource bundles and associate
> each one with a bundle name. However the problem with this
> approach is
> that I have to modify all of my struts tags to use statically defined
> bundle names. Does anyone know of another way I can resolve this
> problem?
>
> Thanks,
>
> Scott Carter
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org