changeset 4508:8cfb1c6d62f3

7073906: Locale.getDefault() returns wrong Locale for Java SE 7 Reviewed-by: okutsu
author naoto
date Fri, 11 Nov 2011 14:22:10 -0800
parents cdfc6747cd3c
children 5c50ffbaa26a
files src/windows/native/java/lang/java_props_md.c
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/native/java/lang/java_props_md.c	Fri Nov 11 18:11:30 2011 +0900
+++ b/src/windows/native/java/lang/java_props_md.c	Fri Nov 11 14:22:10 2011 -0800
@@ -563,6 +563,18 @@
         {
             char * display_encoding;
 
+            // Windows UI Language selection list only cares "language"
+            // information of the UI Language. For example, the list
+            // just lists "English" but it actually means "en_US", and
+            // the user cannot select "en_GB" (if exists) in the list.
+            // So, this hack is to use the user LCID region information
+            // for the UI Language, if the "language" portion of those
+            // two locales are the same.
+            if (PRIMARYLANGID(LANGIDFROMLCID(userDefaultLCID)) ==
+                PRIMARYLANGID(LANGIDFROMLCID(userDefaultUILang))) {
+                userDefaultUILang = userDefaultLCID;
+            }
+
             SetupI18nProps(userDefaultUILang,
                            &sprops.language,
                            &sprops.script,