Added in API level 28

LocaleData


class LocaleData
kotlin.Any
   ↳ android.icu.util.LocaleData

A class for accessing miscellaneous data in the locale bundles

Summary

Nested classes

Enumeration for representing the measurement systems.

A class that represents the size of letter head used in the country

Constants
static Int

Delimiter type for getDelimiter(int).

static Int

Delimiter type for getDelimiter(int).

static Int

Delimiter type for getDelimiter(int).

static Int

Delimiter type for getDelimiter(int).

Public methods
static VersionInfo!

Returns the current CLDR version

String!

Retrieves a delimiter string from the locale data.

static LocaleData!

Gets the LocaleData object associated with the default FORMAT locale

static LocaleData!
getInstance(locale: ULocale!)

Gets the LocaleData object associated with the ULocale specified in locale

static LocaleData.MeasurementSystem!

Returns the measurement system used in the locale specified by the locale.

Boolean

Gets the "no substitute" behavior of this locale data object.

static LocaleData.PaperSize!

Returns the size of paper used in the locale.

Unit

Sets the "no substitute" behavior of this locale data object.

Constants

ALT_QUOTATION_END

Added in API level 28
static val ALT_QUOTATION_END: Int

Delimiter type for getDelimiter(int).

Value: 3

ALT_QUOTATION_START

Added in API level 28
static val ALT_QUOTATION_START: Int

Delimiter type for getDelimiter(int).

Value: 2

QUOTATION_END

Added in API level 28
static val QUOTATION_END: Int

Delimiter type for getDelimiter(int).

Value: 1

QUOTATION_START

Added in API level 28
static val QUOTATION_START: Int

Delimiter type for getDelimiter(int).

Value: 0

Public methods

getCLDRVersion

Added in API level 28
static fun getCLDRVersion(): VersionInfo!

Returns the current CLDR version

getDelimiter

Added in API level 28
fun getDelimiter(type: Int): String!

Retrieves a delimiter string from the locale data.

Parameters
type Int: The type of delimiter string desired. Currently, the valid choices are QUOTATION_START, QUOTATION_END, ALT_QUOTATION_START, or ALT_QUOTATION_END.
Return
String! The desired delimiter string.

getInstance

Added in API level 28
static fun getInstance(): LocaleData!

Gets the LocaleData object associated with the default FORMAT locale

Return
LocaleData! A locale data object.

getInstance

Added in API level 28
static fun getInstance(locale: ULocale!): LocaleData!

Gets the LocaleData object associated with the ULocale specified in locale

Parameters
locale ULocale!: Locale with thich the locale data object is associated.
Return
LocaleData! A locale data object.

getMeasurementSystem

Added in API level 28
static fun getMeasurementSystem(locale: ULocale!): LocaleData.MeasurementSystem!

Returns the measurement system used in the locale specified by the locale.

Parameters
locale ULocale!: The locale for which the measurement system to be retrieved.
Return
LocaleData.MeasurementSystem! MeasurementSystem the measurement system used in the locale.

getNoSubstitute

Added in API level 28
fun getNoSubstitute(): Boolean

Gets the "no substitute" behavior of this locale data object.

Return
Boolean Value for the no substitute behavior. If true, methods of this locale data object will return an error when no data is available for that method, given the locale ID supplied to the constructor.

getPaperSize

Added in API level 28
static fun getPaperSize(locale: ULocale!): LocaleData.PaperSize!

Returns the size of paper used in the locale. The paper sizes returned are always in milli-meters.

Parameters
locale ULocale!: The locale for which the measurement system to be retrieved.
Return
LocaleData.PaperSize! The paper size used in the locale

setNoSubstitute

Added in API level 28
fun setNoSubstitute(setting: Boolean): Unit

Sets the "no substitute" behavior of this locale data object.

Parameters
setting Boolean: Value for the no substitute behavior. If true, methods of this locale data object will return an error when no data is available for that method, given the locale ID supplied to the constructor.