class Language implementsJsonSerializable

Properties

staticprotectedarray $languagesNames
staticprotectedarray $regionsNames
protectedstring $id
protectedstring $code
protectedstring|null $variant
protectedstring|null $region
protectedarray $names
protectedstring $isoName
protectedstring $nativeName

Methods

__construct(string$id)

No description

static array
all()

Get the list of the known languages.

static array
regions()

Get the list of the known regions.

array
getNames()

Get both isoName and nativeName as an array.

string
getId()

Returns the original locale ID.

string
getCode()

Returns the code of the locale "en"/"fr".

string|null
getVariant()

Returns the variant code such as cyrl/latn.

string|null
getVariantName()

Returns the variant such as Cyrillic/Latin.

string|null
getRegion()

Returns the region part of the locale.

string|null
getRegionName()

Returns the region name for the current language.

string
getFullIsoName()

Returns the long ISO language name.

setIsoName(string$isoName)

Set the ISO language name.

string
getFullNativeName()

Return the full name of the language in this language.

setNativeName(string$nativeName)

Set the name of the language in this language.

string
getIsoName()

Returns the short ISO language name.

string
getNativeName()

Get the short name of the language in this language.

string
getIsoDescription()

Get a string with short ISO name, region in parentheses if applicable, variant in parentheses if applicable.

string
getNativeDescription()

Get a string with short native name, region in parentheses if applicable, variant in parentheses if applicable.

string
getFullIsoDescription()

Get a string with long ISO name, region in parentheses if applicable, variant in parentheses if applicable.

string
getFullNativeDescription()

Get a string with long native name, region in parentheses if applicable, variant in parentheses if applicable.

string
__toString()

Returns the original locale ID.

jsonSerialize()

No description

Details

at line64
__construct(string$id)

Parameters

string $id

at line86
staticarray all()

Get the list of the known languages.

Return Value

array

at line100
staticarray regions()

Get the list of the known regions.

Return Value

array

at line114
array getNames()

Get both isoName and nativeName as an array.

Return Value

array

at line131
string getId()

Returns the original locale ID.

Return Value

string

at line141
string getCode()

Returns the code of the locale "en"/"fr".

Return Value

string

at line151
string|null getVariant()

Returns the variant code such as cyrl/latn.

Return Value

string|null

at line161
string|null getVariantName()

Returns the variant such as Cyrillic/Latin.

Return Value

string|null

at line179
string|null getRegion()

Returns the region part of the locale.

Return Value

string|null

at line189
string|null getRegionName()

Returns the region name for the current language.

Return Value

string|null

at line199
string getFullIsoName()

Returns the long ISO language name.

Return Value

string

at line213
setIsoName(string$isoName)

Set the ISO language name.

Parameters

string $isoName

at line225
string getFullNativeName()

Return the full name of the language in this language.

Return Value

string

at line239
setNativeName(string$nativeName)

Set the name of the language in this language.

Parameters

string $nativeName

at line251
string getIsoName()

Returns the short ISO language name.

Return Value

string

at line263
string getNativeName()

Get the short name of the language in this language.

Return Value

string

at line275
string getIsoDescription()

Get a string with short ISO name, region in parentheses if applicable, variant in parentheses if applicable.

Return Value

string

at line288
string getNativeDescription()

Get a string with short native name, region in parentheses if applicable, variant in parentheses if applicable.

Return Value

string

at line301
string getFullIsoDescription()

Get a string with long ISO name, region in parentheses if applicable, variant in parentheses if applicable.

Return Value

string

at line314
string getFullNativeDescription()

Get a string with long native name, region in parentheses if applicable, variant in parentheses if applicable.

Return Value

string

at line327
string __toString()

Returns the original locale ID.

Return Value

string

at line338
jsonSerialize()