Balasubramaniam, Sezhiyan wrote:
Hi All,

We are using STRUTS 1.1 for one of our Internet STRUTS application.

In that we provided the multiple languages support using different files
like

ApplicationResources_en.properties

ApplicationResources_de.properties

ApplicationResources_es.properties

ApplicationResources_fr.properties

It worked fine.

Recently we are trying to give more specific locales to the different
English-speaking people and we created specific resources like,

ApplicationResources_en_US.properties

ApplicationResources_en_CA.properties

ApplicationResources_en_GB.properties

We are having the right locale in the "locale" session object, but
always STRUTS picking up the" _en" properties instead the more specific
ones.

Can you please shed some light, where we went wrong?

Is the resource bundle file names are right OR any case sensitive/naming
issues involved?

The case you've used is right. Are you sure you've set the locale in the right place? What is 'the "locale" session object'? I.e. what session attribute is the locale stored in? By default it should be "org.apache.struts.action.LOCALE".

Other question is can we create a resource bundle called
ApplicationResources_en_CN.properties for the Chinese people with
English properties?

Struts will pick this up OR it will discard as this is not the valid
combination?

It should work just fine; there is no non-valid combination. Java lets you create Locale objects with any arbitrary language / country codes. I'm not sure what will happen if you call locale-aware methods (e.g. for data formatting) with a non-standard locale, though.

So, yes, Struts will pick up the resource bundle OK, but you might run into trouble elsewhere.

L.


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

Reply via email to