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

Locale.getDefault() returning "fr_BE", Swing components remain in English

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • tbd
    • 11, 17, 21, 25
    • client-libs

      ADDITIONAL SYSTEM INFORMATION :
      Mac OS 15.3, Java SE 11.*, JDK 22.*, OpenJDK 11.*...
      Bug not present on Windows and Linux

      A DESCRIPTION OF THE PROBLEM :
      While Locale.getDefault() returns "fr_BE", Swing components remain in English. However, some Locale's are working correctly, such as Locale.GERMANY (correct translation of buttons and other components)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      See test case below

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The buttons and other Swing components should be translated in French when Locale.setDefault(Locale.FRANCE) is called.
      ACTUAL -
      Components are correctly translated when Locale.setDefault(Locale.GERMANY) is called but not when Locale.setDefault(Locale.FRANCE) is called.

      ---------- BEGIN SOURCE ----------
      import java.util.Locale;
      import javax.swing.JOptionPane;

      public class Test {
      public static void main(String[] args) {

      System.out.println(Locale.getDefault());

      Locale.setDefault(Locale.FRANCE); // Doesn't work
      //Locale.setDefault(Locale.GERMANY); // Works !

      JOptionPane.showConfirmDialog(null, "Default locale: " + Locale.getDefault());
      }

      }

      ---------- END SOURCE ----------

            psadhukhan Prasanta Sadhukhan
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: