Is it possible to use a file named wiht only the language? EXAMPLE: Resource_es.properties I would hope this would cover all Spanish languages, regardless of country. The issue we're having is replicating all of the "es" translated files to the multiple countries we'd like to support. My question is thus: If we leave off the Country from the filename, does it still get picked up, if the user's language is Spanish, using the syntax above?
Appending the locale name to the base name of the bundle effectively links the bundle's usage to a specific locale. When you ask for the bundle using ResourcBundle.getBundle("MyResource"), the getBundle method appends the default locale identifier to the base name and loads the appropriate bundle. The getBundle method provides a graceful degradation algorithm that attempts to find the nearest matched bundle in cases where the specified bundle can't be found or doesn't exist.
In the following search, each element of the search name is separated with an '_' (UNDERSCORE) character. The algorithm searches for bundle names in the following order: <baseclass>+<specific language>+ <specific country>+<specific variant> <baseclass>+<specific language>+ <specific country> <baseclass>+<specific language> <baseclass>+<default language>+ <default country>+<default variant> <baseclass>+<default language>+ <default country> <baseclass>+<default language> <baseclass> If no bundle is found, getBundle throws a MissingResourceException. Regards,
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com