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

NLS: convert the anonymous arrays to named arrays in Java List Resource files

XMLWordPrintable

    • b106
    • generic
    • generic
    • Verified

        The resource file translation is going to be handled by Oracle Translation Factory in the near future. Oracle translation factory does not support anonymous arrays in Java List Resource files. Following content will not be translated in Oracle TF:

        -------------------------------------
        public Object[][] getContents() {
            return new Object[][] {
                { "key1", "translatable text"},
                { "key2", "another text" }
            };
        }
        -------------------------------------

        We should convert the anonymous arrays to named arrays. The previous example can be changed this way:

        -------------------------------------
        private static final Object[][] contents = {
                { "key1", "translatable text" },
                { "key2", "another text" }
            };

        public Object[][] getContents() {
            return contents;
        }
        -------------------------------------

        Impacted files:

        jdk/jdk/src/share/classes/com/sun/tools/example/debug/tty/TTYResources.java
        jdk/jdk/src/share/classes/sun/tools/jconsole/resources/JConsoleResources.java
        jdk/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer.java
        jdk/jdk/src/share/classes/sun/tools/native2ascii/resources/MsgNative2ascii.java

              yhuang Yong Huang (Inactive)
              yhuang Yong Huang (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: