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

Support separate locales for console messages and HTML content.

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 15
    • None
    • tools
    • None

      This derives from the discussion for JDK-8222793.

      It would be good to be able to use separate locales for console messages and HTML content.

      It may not be as hard these days as it once was to separate console messages from HTML messages. Although it would ultimately be desirable to separate the resources into separate bundles, it will be enough to load the resources twice, with different locales, and use the right resource bundle in the right context. This should be possible because messages are now generated by the Messages class, which has its own alias to the resource bundle.
      https://hg.openjdk.java.net/jdk/jdk/file/1617236f5cbb/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Messages.java#l47
      If we change that, we should be most of the way there.

      In other words:
      1. Rename Configuration.getResources() to Configuration.getDocResources()
      2. Add Configuration.getMessageResources()
      3. Use Configuration.getMessageResources() in Messages

      By leaving the default to be getResources (now renamed to getDocResources) this should not affect any existing code except for the use of the new getMessageResources() in Messages. In other words, the main "risk" is that we don't catch all messages which should use the default locale.

            jjg Jonathan Gibbons
            jjg Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: