Yes, JOptionPane is internationalized provided that you have an
internationalized version of the plugin AND the user's computer has the
appropriate locale configured for their Regional Settings (at least for
Windows).

A simple shortcut that avoids having the user change their regional settings
is to set these UIManager properties for the Yes/No/OK/Cancel buttons,
substituting language specific strings as appropriate. As far as I know,
these are the only Strings which JOptionPane supplies itself. The remainder
of the Strings (e.g. title and message) are supplied by the developer.

Object[] settings = {
//...
"OptionPane.cancelButtonText", getLocalizedString("shared.cancel"),
"OptionPane.noButtonText", getLocalizedString("shared.no"),
"OptionPane.okButtonText", getLocalizedString("shared.ok"),
"OptionPane.yesButtonText", getLocalizedString("shared.yes"),
//...
};
UIDefaults defaults = UIManager.getDefaults();
defaults.putDefaults(settings);


The call to getLocalizedString() is simply our convenience call to a
ResourceBundle lookup.


-----Original Message-----
From: Keith Bennett
To: Bharat
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: 9/27/01 10:43 AM
Subject: Re: Is JOptionPane internationalized ?

Bharat -

Check to see if the rt.jar in your Solaris JRE contains a Japanese
language file named basic_jp.properties.  This is the file would
probably contain the Japanese strings.  (The file basic.properties is
what contains the English strings.)

However, there are several problems with JFileChooser.  For details,
check out the Javadoc in this "TFileChooser" class I wrote:

http://www.cpcug.org/user/kbennett/java/TFileChooser.java

Use of this class, and supporting configuration, corrects the
JFileChooser problems.  Hopefully in JDK 1.4 these things will all be
fixed.

By the way, can anyone suggest a place for me to send/put this file so
that it is available to the Java community?

Thanks.

- Keith


> Bharat wrote:
> 
> Hi folks,
> 
> I am testing my software for internationalization (Japanese) on w2k
> and solaris. I am using JOptionPane for warning dialogs, error dialogs
> etc. On Japanese W2k machine the "OK", "Cancel".. buttons are
> displayed in Japanese but on Japanese solaris machine they are still
> displayed in english.
> I am using jre1.3. Are there any registered bug for this? I saw some
> bugs but they all are closed.
> 
> Thanks
> - bharat
> 
>
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to