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: I18N - Locale



Josef Henryson <email@hidden> wrote:

>Does anyone know how:
>
>Locale.getDefault().getLanguage() & Locale.getDefault().getCountry()
>
>can return sv & SE respectively
>
>when the region and language is set to Netherlands/Dutch in the System
>preferences?

The Language tab of the International panel in System Preferences should
determine the default Locale, via system properties whose values depend on
the International pane's settings.

Specifically, the first language in the Languages list determines the
primary Locale language.  The Formats tab's Region chooser determines the
secondary country part of the Locale.  However, there are not Locale
objects for every possible combination of language and country.  For
example, there are en_US and en_GB variants, but no es_US (Spanish spoken
in the US).

The default Locale object itself is determined by these system properties
in 1.4:
  user.country
  user.language
  user.variant

I suggest writing a small Java app that list's the value of those
properties, then change your settings in System Preferences, rerun the
program, and observe any changes.

Also, there may not be a Locale class that corresponds to the property
values.  If that happens, a fallback Locale will be chosen.  See the source
of Locale.java for the algorithm that selects the default Locale.


>I do have a Swedish keyboard and use the Swedish input menu.

That may explain what you're seeing.  Try changing the System Preferences
setting, rerunning your test program, and observing any change in the
properties.


> But the
>same thing happens to a Dutch colleague with no Swedish settings in his
>computer.

Run the test program and see what the property values are on his machine.

  -- 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.