-
Enhancement
-
Resolution: Fixed
-
P3
-
None
-
None
-
b10
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.
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.
- relates to
-
JDK-8222793 Javadoc tool ignores "-locale" param and uses default locale for all messages and texts
- Resolved