Class

LocaleList

Defines a list of Locale objects.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
Common
class LocaleList(val localeList: List<Locale>) : Collection<Locale>

Defines a list of Locale objects.

Secondary Constructors

constructor(
    languageTags: String
) : this(languageTags.split(",").fastMap { it.trim() }.fastMap { Locale(it) })

Create a LocaleList object from comma separated language tags.

Parameters

languageTags A comma separated IETF BCP47 compliant language tag.
constructor(vararg locales: Locale) : this(locales.toList())

Creates a LocaleList object from a list of Locales.

Functions

get

operator fun get(i: Int) = localeList[i]

Companion Object

Properties

Common
val Empty = LocaleList(listOf())

An empty instance of LocaleList. Usually used to reference a lack of explicit Locale configuration.

Common
val current: LocaleList

Returns Locale object which represents current locale