JDK-8214574 : JOptionPane confirm dialog buttons are not localized
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 11,12
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_10
  • CPU: x86_64
  • Submitted: 2018-11-29
  • Updated: 2019-09-10
  • Resolved: 2019-09-10
Related Reports
Duplicate :  
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)

A DESCRIPTION OF THE PROBLEM :
The button labels in JOptionPane confirm dialogs with JOptionPane.YES_NO_OPTION are not localized. Tested with Locale.ITALY and Locale.GERMANY.

REGRESSION : Last worked in version 10.0.1

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the given code

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Buttons are labeled _S_i and _N_o
ACTUAL -
Buttons are labeled _Y_es and _N_o

---------- BEGIN SOURCE ----------
package testcase.yesnooption;

import java.util.Locale;
import javax.swing.JOptionPane;

public class MainApp {

    public static void main(final String[] args) {
        Locale.setDefault(Locale.ITALY);
        JOptionPane.showConfirmDialog(null, "Is this localized?", "Localized or not",
                JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
    }
}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Use Java 8, 9 or 10

FREQUENCY : always



Comments
AFAIK, we no longer support those translations in Oracle builds of the JDK. I did not impose this policy, I was just asked to implement it.
23-01-2019

Looks like result of JDK-8204973.
22-01-2019

Reported as a regression in JDK 11.0.1, the button labels in JOptionPane confirm dialogs with JOptionPane.YES_NO_OPTION are not localized. Results: ======== 8u191: OK 9: OK 10.0.2: OK 11: Fail 12 ea b22: Fail Confirmed regression in JDK 11. To verify, run the attached test case with respective JDk versions.
01-12-2018