trait LocaleTrait (View source)

Properties

protected string $msLanguage The language code.
protected string $msCountry The Country/territory code.
protected int $msNumPlurals The number of plural rules used in this locale.
protected string $msPluralRule The plural rules definition of this locale (using gettext format).
protected string $msPluralCases The plural rule names with examples (using CLDR format).

Methods

string
getLanguage()

Get the language code.

setLanguage(string $msLanguage)

Set the language code.

string
getCountry()

Get the Country/territory code.

setCountry(string $msCountry)

Set the Country/territory code.

int
getNumPlurals()

Get the number of plural rules used in this locale.

setNumPlurals(int $msNumPlurals)

Set the number of plural rules used in this locale.

string
getPluralRule()

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

setPluralRule(string $msPluralRule)

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

array
getPluralCases()

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

setPluralCases(string $msPluralCases)

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

string
getLocale()

Get the full code of this locale.

string
getLanguageText(string|null $locale = null)

Get the display name of this locale.

getExporter()

Get the object to be used to export this item to aSimpleXMLElement.

Details

string getLanguage()

Get the language code.

Return Value

string

setLanguage(string $msLanguage)

Set the language code.

Parameters

string $msLanguage

string getCountry()

Get the Country/territory code.

Return Value

string

setCountry(string $msCountry)

Set the Country/territory code.

Parameters

string $msCountry

int getNumPlurals()

Get the number of plural rules used in this locale.

Return Value

int

setNumPlurals(int $msNumPlurals)

Set the number of plural rules used in this locale.

Parameters

int $msNumPlurals

string getPluralRule()

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

Return Value

string

setPluralRule(string $msPluralRule)

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

Parameters

string $msPluralRule

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

setPluralCases(string $msPluralCases)

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

Parameters

string $msPluralCases

string getLocale()

Get the full code of this locale.

Return Value

string

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

Locale getExporter()

Get the object to be used to export this item to aSimpleXMLElement.

Return Value

Locale