Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4399413

ResourceBundle.getBundle should have better support for variants

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P5 P5
    • None
    • 1.3.0
    • core-libs



      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)
      ======================================================================

            joconnersunw John Oconner (Inactive)
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: