ICU-7082 Revise display handling constant names per Markus's suggestions and to align with ICU4C
X-SVN-Rev: 27268
This commit is contained in:
parent
763489b754
commit
335af0d393
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2009, International Business Machines Corporation and *
|
||||
* Copyright (C) 2009-2010, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
*/
|
||||
@ -111,7 +111,7 @@ public class LocaleDisplayNamesImpl extends LocaleDisplayNames {
|
||||
boolean hasVariant = variant.length() > 0;
|
||||
|
||||
if (hasLang) {
|
||||
if (dialectHandling == DialectHandling.USE_DIALECT_NAMES) {
|
||||
if (dialectHandling == DialectHandling.DIALECT_NAMES) {
|
||||
do { // loop construct is so we can break early out of search
|
||||
if (hasScript && hasCountry) {
|
||||
String langScriptCountry = lang + '_' + script + '_' + country;
|
||||
|
@ -28,13 +28,13 @@ public abstract class LocaleDisplayNames {
|
||||
* e.g. en_GB displays as 'English (United Kingdom)'.
|
||||
* @draft ICU 4.4
|
||||
*/
|
||||
STANDARD,
|
||||
STANDARD_NAMES,
|
||||
/**
|
||||
* Use dialect names, when generating a locale name,
|
||||
* Use dialect names when generating a locale name,
|
||||
* e.g. en_GB displays as 'British English'.
|
||||
* @draft ICU 4.4
|
||||
*/
|
||||
USE_DIALECT_NAMES
|
||||
DIALECT_NAMES
|
||||
}
|
||||
|
||||
// factory methods
|
||||
@ -46,7 +46,7 @@ public abstract class LocaleDisplayNames {
|
||||
* @draft ICU 4.4
|
||||
*/
|
||||
public static LocaleDisplayNames getInstance(ULocale locale) {
|
||||
return getInstance(locale, DialectHandling.STANDARD);
|
||||
return getInstance(locale, DialectHandling.STANDARD_NAMES);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
******************************************************************************
|
||||
* Copyright (C) 2003-2009, International Business Machines Corporation and *
|
||||
* Copyright (C) 2003-2010, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
******************************************************************************
|
||||
*/
|
||||
@ -1491,7 +1491,7 @@ public final class ULocale implements Serializable {
|
||||
}
|
||||
|
||||
private static String getDisplayNameWithDialectInternal(ULocale locale, ULocale displayLocale) {
|
||||
return LocaleDisplayNames.getInstance(displayLocale, DialectHandling.USE_DIALECT_NAMES)
|
||||
return LocaleDisplayNames.getInstance(displayLocale, DialectHandling.DIALECT_NAMES)
|
||||
.localeDisplayName(locale);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user