JDK-4399413 : ResourceBundle.getBundle should have better support for variants
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 1.3.0
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2000-12-19
  • Updated: 2001-11-14
  • Resolved: 2001-11-14
Related Reports
Duplicate :  
Description

Name: krC82822			Date: 12/19/2000


java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

When using resource bundles, it should be possible to have variants of the root
resource bundle (#3 below). For example, if I am using a Swing Look & Feel as a
variant for my resource bundles, I should be able to provide a root resource
bundle that is different for each resource bundle. In particular, if I have
URL's of icons in a resource bundle (particularly a property-backed resource
bundle), I should be able to provide default icons that are different for each
Look and Feel without having to duplicate them all in each Language/Country
pair. The reasoning is that the icons are usually less language/country
specific and in fact there are many "Universal" or "International" symbols that
could be used as icons. These "universal" symbols might need slight variations
in order to fit in with a look and feel, but they do not depend on the language
or the country. The current scheme only allows the variant (the Look and Feel
in this case) to be provided if BOTH the language and country are matched.

Here is the resolving order that I am proposing:

baseclass "_" language1 "_" country1 "_" variant1
baseclass "_" language1 "_" country1 "_" variant1 ".properties"
baseclass "_" language1 "_" country1
baseclass "_" language1 "_" country1 ".properties"
baseclass "_" language1
baseclass "_" language1 ".properties"
baseclass "_" language2 "_" country2 "_" variant2
baseclass "_" language2 "_" country2 "_" variant2 ".properties"
baseclass "_" language2 "_" country2
baseclass "_" language2 "_" country2 ".properties"
baseclass "_" language2
baseclass "_" language2 ".properties"

baseclass "_" varient3                   <-- THESE TWO ARE NEW!
baseclass "_" varient3 ".properties"

baseclass
baseclass ".properties"

I can provide an example of a set of resource bundles where this is needed if
you contact me by email.
(Review ID: 108793) 
======================================================================

Comments
WORK AROUND Name: krC82822 Date: 12/19/2000 (1) Copy the varient (look and feel) -specific information into each language/country resource bundle that you need to support. (2) Provide very generic information (icons in my example) that can be used in all variants (Look&Feels). ======================================================================
11-06-2004

EVALUATION This should be considered part of the work to open up the ResourceBundle search strategy. ###@###.### 2001-11-14
14-11-2001