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: Default Locale for United Kingdom



Ian Cheyne wrote:

>>AFAIK, Java's default Locale depends on two things, regardless of platform:
>>  1) the values of several "user.*" system properties.
>>  2) the presence of Locale bundles.
>
>I haven't checked the first. Do you mean from Java or from the command
>line or both?

I mean the Strings returned by java.lang.System.getProperty(String).  The
relevant values should be getting set regardless of how the JVM is
executed: double-clicked jar, app-bundle, or 'java' command.

The key-Strings that java.util.Locale uses in 1.4 are:
  "user.language"
  "user.country"
  "user.variant"

To see exactly how the default Locale's name is generated from System
properties, read the source for Locale.

The value for "user.country" should be "GB" or "US" or "CA" whatever.  If
it isn't changing correctly, then that's why the Locale is wrong.  Fix the
System Properties value and the Locale should then be correct.

The value for "user.language" should be "en" for all varieties of English.
It should change, too.  Try moving Canadian French and Canadian English to
the top of the Languages list and see what happens.

The default language-name in Locale's source is "en", so if there's no
"user.language" value, the default Locale comes up as English.

In J2SE 1.3, the property named "user.region" is used, not "user.country".
The code for 1.4's Locale is backwards compatible in the presence of a
"user.region" property.  I don't know what J2SE 5.0 does, because I haven't
looked at its source.

It may be worth printing the values of the System properties, not just the
Locale that results from the properties.  It may also be worth running the
test on 10.4 using the 1.3 JVM, since it's still available, and probably
has less in common with 1.4, than 1.4 does with 1.5.


>I reckon this is a bug and will lodge a bug report - does this go against
>the operating system or Java?

I'd file it against Java, because that's where the symptoms are directly
visible.  Let Apple figure out whether it's deeper than that.

  -- GG


 _______________________________________________
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



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.