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

split message resources on ControlPanel cannot be localized properly

XMLWordPrintable

    • b13
    • generic
    • generic
    • Verified

      In splitting or combining message text, it should be one-to-one correspondence
      with a resource key.

      src/plugin/src/share/classes/sun/plugin/panel/UpdatePanel.java:
      line 221-
                  str1 = (String)at.getItemAt(at.getSelectedIndex());
                  String atstr = msgfmt.format(new String[]{str1});

                  if (RButton1.isSelected()) {
                      day.setVisible(false);
                      every.setVisible(false);
                      whenLabel1.setText(" ");
                      whenLabel2.setText(atLabelText);
                      whenPanel1.add(dummyLabel);
                      whenPanel2.add(at);
                      at.setVisible(true);
                      dummyLabel.setVisible(true);
                      str = mh.getMessage("advanced_desc1.text");
                      str1 = null;
                  } else if (RButton2.isSelected()) {
                      day.setVisible(false);
                      dummyLabel.setVisible(false);
                      whenLabel1.setText(everyLabelText);
                      whenLabel2.setText(atLabelText);
                      whenPanel1.add(every, c);
                      whenPanel2.add(at);
                      every.setVisible(true);
                      at.setVisible(true);
                      str1 = (String) every.getItemAt(every.getSelectedIndex());
                      str = mh.getMessage("advanced_desc2.text");
                  } else if (RButton3.isSelected()) {
                      dummyLabel.setVisible(false);
                      every.setVisible(false);
                      whenLabel1.setText(dayLabelText);
                      whenLabel2.setText(atLabelText);
                      whenPanel1.add(day);
                      whenPanel2.add(at);
                      day.setVisible(true);
                      at.setVisible(true);
                      str1 = String.valueOf(((Integer)day.getValue()).intValue());
                      str = mh.getMessage("advanced_desc3.text");
                  }
                  if (str1 != null) {
                      msgfmt = new MessageFormat(str);
                      str = msgfmt.format(new String[]{str1});
                  }
                  descLabel.setText(str+atstr);
                            :
          private String atText = mh.getMessage("advanced_at.text");

      src/plugin/src/share/classes/sun/plugin/resources/ControlPanel.java:
              { "update.advanced_desc1.text", "Perform scan every day " },
              { "update.advanced_desc2.text", "Perform scan every {0} " },
              { "update.advanced_desc3.text", "Perform scan on day {0} of every month " },
              { "update.advanced_at.text", "at {0}" },

      These message resources should be:
              { "update.advanced_desc1.text", "Perform scan every day at {0}" },
              { "update.advanced_desc2.text", "Perform scan every {1} at {0}" },
              { "update.advanced_desc3.text", "Perform scan on day {1} of every month at {0}" },

            mafishersunw Margarita Fisher (Inactive)
            kurosaki Kenichi Kurosaki (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: