Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JFileChooser localization



Jeremy,

Most look and feels put their resource bundles into the UIManager, and get
the labels using UIManager.getString().

For a list of available properties, take a look at the resource bundle used
by BasicLookAndFeel. The name of the resource bundle is:

com.sun.swing.internal.plaf.basic.resources.basic


You can use UIManager.put to replace a string. The BasicLookAndFeel does not
have a choose button text. So, I just blindly tried the following, and it
appeared to be working:

UIManager.put("FileChooser.chooseButtonText","Elija");
 
Of course, this is just a work around, which might break at any time with a
future release of the JVM.

I suggest, that you do file a bug report for this issue with Apple. This is
the only way to get this solved reliably.

With kind regards,
Werner Randelshofer





On 12.04.06 19:37 Uhr, "Jeremy Wood" at <email@hidden> wrote:
> On Java 1.4 and Java 1.5 on Mac:
> 
> We have a JFileChooser that we use to load directories.  When we set
> our JVM to run in Spanish, buttons like "OK" and "Cancel" are
> localized.  But buttons like "Choose" are not.
> 
> A little further research shows that the "laf.jar" (deep in
> System/Library/Frameworks/JavaVM...) seems to contain these localized
> strings, and it's only localized in French, Japanese, and German.
> 
> (Sure enough, we launch in one of those locales the "Choose" button IS
> localized.  But if we launch in Spanish, Chinese or Italian, the
> "Choose" button is not.)
> 
> So what are our options?  Our goal is to localize the "Choose" button
> into Spanish.  Do we need to/can we snake inside the JFileChooser
> object, grab that button, and localize it ourselves?  That seems like
> our best option for now.
> 
> Also this is unlike other problems we've seen before, is it safe to
> call this a "bug" and file it with Apple?  (Has someone already done
> so?)
> 
> I assume somehow supplementing the "laf.jar" file is completely out of
> the question, since it's deep in the System folder.  (We probably don't
> have permissions anyway, besides the principle of mucking with such an
> important class is frightening.)
> 
> This appears to be a look-and-feel issue; we don't have this problem on
> Windows XP.
> 
> Thoughts?

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >JFileChooser localization (From: Jeremy Wood <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.