LocaleDisplayNames
abstract class LocaleDisplayNames
kotlin.Any | |
↳ | android.icu.text.LocaleDisplayNames |
Returns display names of ULocales and components of ULocales. For more information on language, script, region, variant, key, and values, see android.icu.util.ULocale
.
Summary
Nested classes | |
---|---|
Enum used in |
|
open |
Struct-like class used to return information for constructing a UI list, each corresponding to a locale. |
Public methods | |
---|---|
abstract DisplayContext! |
getContext(type: DisplayContext.Type!) Returns the current value for a specified DisplayContext. |
abstract LocaleDisplayNames.DialectHandling! |
Returns the dialect handling used in the display names. |
open static LocaleDisplayNames! |
getInstance(locale: ULocale!) Convenience overload of |
open static LocaleDisplayNames! |
getInstance(locale: ULocale!, vararg contexts: DisplayContext!) Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale, using the provided DisplayContext settings |
open static LocaleDisplayNames! |
getInstance(locale: ULocale!, dialectHandling: LocaleDisplayNames.DialectHandling!) Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale, using the provided dialectHandling. |
open static LocaleDisplayNames! |
getInstance(locale: Locale!) Convenience overload of |
open static LocaleDisplayNames! |
getInstance(locale: Locale!, vararg contexts: DisplayContext!) Returns an instance of LocaleDisplayNames that returns names formatted for the provided |
abstract ULocale! |
Returns the locale used to determine the display names. |
open MutableList<LocaleDisplayNames.UiListItem!>! |
getUiList(localeSet: MutableSet<ULocale!>!, inSelf: Boolean, collator: Comparator<Any!>!) Return a list of information used to construct a UI list of locale names. |
abstract MutableList<LocaleDisplayNames.UiListItem!>! |
getUiListCompareWholeItems(localeSet: MutableSet<ULocale!>!, comparator: Comparator<LocaleDisplayNames.UiListItem!>!) Return a list of information used to construct a UI list of locale names, providing more access to control the sorting. |
abstract String! |
keyDisplayName(key: String!) Returns the display name of the provided locale key. |
abstract String! |
keyValueDisplayName(key: String!, value: String!) Returns the display name of the provided value (used with the provided key). |
abstract String! |
languageDisplayName(lang: String!) Returns the display name of the provided language code. |
abstract String! |
localeDisplayName(locale: ULocale!) Returns the display name of the provided ulocale. |
abstract String! |
localeDisplayName(localeId: String!) Returns the display name of the provided locale id. |
abstract String! |
localeDisplayName(locale: Locale!) Returns the display name of the provided locale. |
abstract String! |
regionDisplayName(region: String!) Returns the display name of the provided region code. |
abstract String! |
scriptDisplayName(scriptCode: Int) Returns the display name of the provided script code. |
abstract String! |
scriptDisplayName(script: String!) Returns the display name of the provided script code. |
abstract String! |
variantDisplayName(variant: String!) Returns the display name of the provided variant. |
Public methods
getContext
abstract fun getContext(type: DisplayContext.Type!): DisplayContext!
Returns the current value for a specified DisplayContext.Type.
Parameters | |
---|---|
type |
DisplayContext.Type!: the DisplayContext.Type whose value to return |
Return | |
---|---|
DisplayContext! |
the current DisplayContext setting for the specified type |
getDialectHandling
abstract fun getDialectHandling(): LocaleDisplayNames.DialectHandling!
Returns the dialect handling used in the display names.
Return | |
---|---|
LocaleDisplayNames.DialectHandling! |
the dialect handling enum |
getInstance
open static fun getInstance(locale: ULocale!): LocaleDisplayNames!
Convenience overload of getInstance(android.icu.util.ULocale,android.icu.text.LocaleDisplayNames.DialectHandling)
that specifies STANDARD dialect handling.
Parameters | |
---|---|
locale |
ULocale!: the display locale |
Return | |
---|---|
LocaleDisplayNames! |
a LocaleDisplayNames instance |
getInstance
open static fun getInstance(
locale: ULocale!,
vararg contexts: DisplayContext!
): LocaleDisplayNames!
Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale, using the provided DisplayContext settings
Parameters | |
---|---|
locale |
ULocale!: the display locale |
contexts |
DisplayContext!: one or more context settings (e.g. for dialect handling, capitalization, etc. |
Return | |
---|---|
LocaleDisplayNames! |
a LocaleDisplayNames instance |
getInstance
open static fun getInstance(
locale: ULocale!,
dialectHandling: LocaleDisplayNames.DialectHandling!
): LocaleDisplayNames!
Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale, using the provided dialectHandling.
Parameters | |
---|---|
locale |
ULocale!: the display locale |
dialectHandling |
LocaleDisplayNames.DialectHandling!: how to select names for locales |
Return | |
---|---|
LocaleDisplayNames! |
a LocaleDisplayNames instance |
getInstance
open static fun getInstance(locale: Locale!): LocaleDisplayNames!
Convenience overload of getInstance(java.util.Locale,android.icu.text.DisplayContext...)
that specifies DisplayContext.STANDARD_NAMES
.
Parameters | |
---|---|
locale |
Locale!: the display java.util.Locale |
Return | |
---|---|
LocaleDisplayNames! |
a LocaleDisplayNames instance |
getInstance
open static fun getInstance(
locale: Locale!,
vararg contexts: DisplayContext!
): LocaleDisplayNames!
Returns an instance of LocaleDisplayNames that returns names formatted for the provided java.util.Locale
, using the provided DisplayContext settings
Parameters | |
---|---|
locale |
Locale!: the display java.util.Locale |
contexts |
DisplayContext!: one or more context settings (e.g. for dialect handling, capitalization, etc. |
Return | |
---|---|
LocaleDisplayNames! |
a LocaleDisplayNames instance |
getLocale
abstract fun getLocale(): ULocale!
Returns the locale used to determine the display names. This is not necessarily the same locale passed to #getInstance.
Return | |
---|---|
ULocale! |
the display locale |
getUiList
open fun getUiList(
localeSet: MutableSet<ULocale!>!,
inSelf: Boolean,
collator: Comparator<Any!>!
): MutableList<LocaleDisplayNames.UiListItem!>!
Return a list of information used to construct a UI list of locale names.
Parameters | |
---|---|
collator |
Comparator<Any!>!: how to collate—should normally be Collator.getInstance(getDisplayLocale()) |
inSelf |
Boolean: if true, compares the nameInSelf, otherwise the nameInDisplayLocale. Set depending on which field (displayLocale vs self) is to show up in the UI. If both are to show up in the UI, then it should be the one used for the primary sort order. |
localeSet |
MutableSet<ULocale!>!: a list of locales to present in a UI list. The casing uses the settings in the LocaleDisplayNames instance. |
Return | |
---|---|
MutableList<LocaleDisplayNames.UiListItem!>! |
an ordered list of UiListItems. |
Exceptions | |
---|---|
android.icu.util.IllformedLocaleException |
if any of the locales in localeSet are malformed. |
getUiListCompareWholeItems
abstract fun getUiListCompareWholeItems(
localeSet: MutableSet<ULocale!>!,
comparator: Comparator<LocaleDisplayNames.UiListItem!>!
): MutableList<LocaleDisplayNames.UiListItem!>!
Return a list of information used to construct a UI list of locale names, providing more access to control the sorting. Normally use getUiList instead.
Parameters | |
---|---|
comparator |
Comparator<LocaleDisplayNames.UiListItem!>!: how to sort the UiListItems in the result. |
localeSet |
MutableSet<ULocale!>!: a list of locales to present in a UI list. The casing uses the settings in the LocaleDisplayNames instance. |
Return | |
---|---|
MutableList<LocaleDisplayNames.UiListItem!>! |
an ordered list of UiListItems. |
Exceptions | |
---|---|
android.icu.util.IllformedLocaleException |
if any of the locales in localeSet are malformed. |
keyDisplayName
abstract fun keyDisplayName(key: String!): String!
Returns the display name of the provided locale key.
Parameters | |
---|---|
key |
String!: the locale key name |
Return | |
---|---|
String! |
the display name of the provided locale key |
keyValueDisplayName
abstract fun keyValueDisplayName(
key: String!,
value: String!
): String!
Returns the display name of the provided value (used with the provided key).
Parameters | |
---|---|
key |
String!: the locale key name |
value |
String!: the locale key's value |
Return | |
---|---|
String! |
the display name of the provided value |
languageDisplayName
abstract fun languageDisplayName(lang: String!): String!
Returns the display name of the provided language code.
Parameters | |
---|---|
lang |
String!: the language code |
Return | |
---|---|
String! |
the display name of the provided language code |
localeDisplayName
abstract fun localeDisplayName(locale: ULocale!): String!
Returns the display name of the provided ulocale. When no display names are available for all or portions of the original locale ID, those portions may be used directly (possibly in a more canonical form) as part of the returned display name.
Parameters | |
---|---|
locale |
ULocale!: the locale whose display name to return |
Return | |
---|---|
String! |
the display name of the provided locale |
localeDisplayName
abstract fun localeDisplayName(localeId: String!): String!
Returns the display name of the provided locale id. When no display names are available for all or portions of the original locale ID, those portions may be used directly (possibly in a more canonical form) as part of the returned display name.
Parameters | |
---|---|
localeId |
String!: the id of the locale whose display name to return |
Return | |
---|---|
String! |
the display name of the provided locale |
localeDisplayName
abstract fun localeDisplayName(locale: Locale!): String!
Returns the display name of the provided locale. When no display names are available for all or portions of the original locale ID, those portions may be used directly (possibly in a more canonical form) as part of the returned display name.
Parameters | |
---|---|
locale |
Locale!: the locale whose display name to return |
Return | |
---|---|
String! |
the display name of the provided locale |
regionDisplayName
abstract fun regionDisplayName(region: String!): String!
Returns the display name of the provided region code.
Parameters | |
---|---|
region |
String!: the region code |
Return | |
---|---|
String! |
the display name of the provided region code |
scriptDisplayName
abstract fun scriptDisplayName(scriptCode: Int): String!
Returns the display name of the provided script code. See android.icu.lang.UScript
for recognized script codes.
Parameters | |
---|---|
scriptCode |
Int: the script code number |
Return | |
---|---|
String! |
the display name of the provided script code |
scriptDisplayName
abstract fun scriptDisplayName(script: String!): String!
Returns the display name of the provided script code.
Parameters | |
---|---|
script |
String!: the script code |
Return | |
---|---|
String! |
the display name of the provided script code |
variantDisplayName
abstract fun variantDisplayName(variant: String!): String!
Returns the display name of the provided variant.
Parameters | |
---|---|
variant |
String!: the variant string |
Return | |
---|---|
String! |
the display name of the provided variant |