equal
deleted
inserted
replaced
856 return getDefault(); |
856 return getDefault(); |
857 } |
857 } |
858 |
858 |
859 private static Locale initDefault() { |
859 private static Locale initDefault() { |
860 String language, region, script, country, variant; |
860 String language, region, script, country, variant; |
861 Properties props = GetPropertyAction.getProperties(); |
861 Properties props = GetPropertyAction.privilegedGetProperties(); |
862 language = props.getProperty("user.language", "en"); |
862 language = props.getProperty("user.language", "en"); |
863 // for compatibility, check for old user.region property |
863 // for compatibility, check for old user.region property |
864 region = props.getProperty("user.region"); |
864 region = props.getProperty("user.region"); |
865 if (region != null) { |
865 if (region != null) { |
866 // region can be of form country, country_variant, or _variant |
866 // region can be of form country, country_variant, or _variant |
881 |
881 |
882 return getInstance(language, script, country, variant, null); |
882 return getInstance(language, script, country, variant, null); |
883 } |
883 } |
884 |
884 |
885 private static Locale initDefault(Locale.Category category) { |
885 private static Locale initDefault(Locale.Category category) { |
886 Properties props = GetPropertyAction.getProperties(); |
886 Properties props = GetPropertyAction.privilegedGetProperties(); |
887 return getInstance( |
887 return getInstance( |
888 props.getProperty(category.languageKey, |
888 props.getProperty(category.languageKey, |
889 defaultLocale.getLanguage()), |
889 defaultLocale.getLanguage()), |
890 props.getProperty(category.scriptKey, |
890 props.getProperty(category.scriptKey, |
891 defaultLocale.getScript()), |
891 defaultLocale.getScript()), |