I have 2 propertie files:
ApplicationResources_en.properties
ApplicationResources_nl.properties

So i don't have a ApplicationResources.properties at this time.
But my locale is nl_NL or en_US so it should load!!
My default locale is nl_NL.

but the method:
protected String localeKey(Locale locale)
{
 if (locale == null)  return ("");
 else if (locale.equals(defaultLocale))  return ("");
 else  return (locale.toString());
}

returns "" for my default locale, this is not the right behaviour.
Please implement it as the ResourceBundle does:

Locale = nl_NL

Then it try's to load: ApplicationResources_nl_NL.properties first
if that fails it try's to load: ApplicationResources_nl.properties 
if that fails the last one:ApplicationResources.properties 

The current implementations is wrong because:
My machine has a default locale of nl_NL. So when i want to load nl properties now
i must rename the ApplicationResources_nl.properties to 
ApplicationResources.properties 
(because localeKey() return "")
But now i deploy my app to a server. Then suddenly the default locale is en_US.
The localeKey() methode return "" so it loads the ApplicationResources.properties
But there i have the properties of nl.

So to make it short: Struts should always try to load the current locale (default or 
not)
and walk through the locale (nl_NL.prop then nl.prop and the "".prop) to try to load 
the properties.

Johan Compagner


Reply via email to