interface LocaleInterface (View source)

Methods

int|null
getLocaleID()

Get the locale record identifier.

string
getLanguage()

Get the language code.

string
getCountry()

Get the Country/territory code.

string
getLocale()

Get the full code of this locale.

int
getNumPlurals()

Get the number of plural rules used in this locale.

array
getPluralCases()

Get the plural rule names with examples (using CLDR format).

string
getPluralRule()

Get the plural rules definition of this locale (using gettext format).

setNumPlurals($numPlurals)

Set the number of plural rules used in this locale.

setPluralCases($numCases)

Set the plural rule names with examples (using CLDR format).

setPluralRule($pluralRule)

Set the plural rules definition of this locale (using gettext format).

string
getLanguageText(string|null $locale = null)

Get the display name of this locale.

Details

int|null getLocaleID()

Get the locale record identifier.

Return Value

int|null

string getLanguage()

Get the language code.

Return Value

string

string getCountry()

Get the Country/territory code.

Return Value

string

string getLocale()

Get the full code of this locale.

Return Value

string

int getNumPlurals()

Get the number of plural rules used in this locale.

Return Value

int

array getPluralCases()

Get the plural rule names with examples (using CLDR format).

Return Value

array array keys are the CLDR identifiers or the plural rules (zero, one, two, few, many, other), array values are example values

string getPluralRule()

Get the plural rules definition of this locale (using gettext format).

Return Value

string

setNumPlurals($numPlurals)

Set the number of plural rules used in this locale.

Parameters

$numPlurals

setPluralCases($numCases)

Set the plural rule names with examples (using CLDR format).

Parameters

$numCases

setPluralRule($pluralRule)

Set the plural rules definition of this locale (using gettext format).

Parameters

$pluralRule

string getLanguageText(string|null $locale = null)

Get the display name of this locale.

Parameters

string|null $locale The locale to be used to localize the locale name

Return Value

string