< prev index next >
src/java.base/windows/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 508,519 ****
@Override
public String getDisplayCountry(String countryCode, Locale locale) {
// Retrieves the display country name by calling
// GetLocaleInfoEx(LOCALE_SLOCALIZEDCOUNTRYNAME).
! return getDisplayString(locale.toLanguageTag(),
! DN_LOCALE_REGION, nativeDisplayLanguage+"-"+countryCode);
}
@Override
public String getDisplayScript(String scriptCode, Locale locale) {
return null;
--- 508,526 ----
@Override
public String getDisplayCountry(String countryCode, Locale locale) {
// Retrieves the display country name by calling
// GetLocaleInfoEx(LOCALE_SLOCALIZEDCOUNTRYNAME).
! String str = getDisplayString(locale.toLanguageTag(),
! DN_LOCALE_REGION,
! nativeDisplayLanguage+"-"+countryCode);
! // Hack: Windows 10 returns translated "Unknown Region (XX)"
! // for localized XX region name. Take that as not known.
! if (str != null && str.contains("("+countryCode+")")) {
! return null;
! }
! return str;
}
@Override
public String getDisplayScript(String scriptCode, Locale locale) {
return null;
< prev index next >