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

JOptionPane l10n fails for pt_BR(Brazil)

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version "1.5.0_02"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
      Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode)

      It also fails with all the 1.3 J2SE(but Pt_BR is not officially fully suported under 1.3)

      ADDITIONAL OS VERSION INFORMATION :
      Windows 2000


      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Brazil Language set in the O.S.

      A DESCRIPTION OF THE PROBLEM :
      In an enviroment where system locale is pt_BR JOptionPane.showConfirmDialog(...) using YES_NO_OPTION shows optionPane with buttons in English.

      pt_BR is a fully supported locale un J2SE 1.4.2(http://java.sun.com/j2se/1.4.2/docs/guide/intl/locale.doc.html) so it should show the buttons text in portuguese.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      - In a windows box:

      - Change your system language to protuguese Brazil:Start->Configuration->ControlPanel->LocalConfiguration(or RegionConfiguration)->In the general tab, select Portuguese(Brazil)

      - Show a JOptionPane with YES_NO_OPTION(example code attached)

      - Read the buttons text, it is in English instead or Protuguese


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      pt_BR is a fully supported locale un J2SE 1.4.2(http://java.sun.com/j2se/1.4.2/docs/guide/intl/locale.doc.html) so it should show the buttons text in portuguese.
      ACTUAL -
      JOptionPane buttons text in english instead portuguese

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;

      public class JOptionPanei18nBugBrazil{

      public static void main(String args[]){

          JFrame frame=new JFrame();
          
          frame.show();
          
          JOptionPane.showConfirmDialog(frame,"pt_Br should work?","i18n issue", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);

          }

      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      For a new development you could use showOptionDialog with 2 buttons setting the appropiate text in the buttons.
      If you can't touch the code, no configuration workarround seems posible.
      ###@###.### 2005-04-20 21:44:04 GMT

            Unassigned Unassigned
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: