Language
in package
implements
JsonSerializable
Table of Contents
Interfaces
- JsonSerializable
Properties
- $code : string
- $id : string
- $isoName : string|null
- $languagesNames : array<string|int, mixed>|null
- $names : array<string|int, mixed>|null
- $nativeName : string|null
- $region : string|null
- $regionsNames : array<string|int, mixed>|null
- $variant : string|null
Methods
- __construct() : mixed
- __toString() : string
- Returns the original locale ID.
- all() : array<string|int, mixed>
- Get the list of the known languages.
- getCode() : string
- Returns the code of the locale "en"/"fr".
- getFullIsoDescription() : string
- Get a string with long ISO name, region in parentheses if applicable, variant in parentheses if applicable.
- getFullIsoName() : string
- Returns the long ISO language name.
- getFullNativeDescription() : string
- Get a string with long native name, region in parentheses if applicable, variant in parentheses if applicable.
- getFullNativeName() : string
- Return the full name of the language in this language.
- getId() : string
- Returns the original locale ID.
- getIsoDescription() : string
- Get a string with short ISO name, region in parentheses if applicable, variant in parentheses if applicable.
- getIsoName() : string
- Returns the short ISO language name.
- getNames() : array<string|int, mixed>
- Get both isoName and nativeName as an array.
- getNativeDescription() : string
- Get a string with short native name, region in parentheses if applicable, variant in parentheses if applicable.
- getNativeName() : string
- Get the short name of the language in this language.
- getRegion() : string|null
- Returns the region part of the locale.
- getRegionName() : string|null
- Returns the region name for the current language.
- getVariant() : string|null
- Returns the variant code such as cyrl/latn.
- getVariantName() : string|null
- Returns the variant such as Cyrillic/Latin.
- jsonSerialize() : string
- Get a string with short ISO name, region in parentheses if applicable, variant in parentheses if applicable.
- regions() : array<string|int, mixed>
- Get the list of the known regions.
- setIsoName() : static
- Set the ISO language name.
- setNativeName() : static
- Set the name of the language in this language.
Properties
$code
protected
string
$code
$id
protected
string
$id
$isoName
protected
string|null
$isoName
= null
$languagesNames
protected
static array<string|int, mixed>|null
$languagesNames
= null
$names
protected
array<string|int, mixed>|null
$names
= null
$nativeName
protected
string|null
$nativeName
= null
$region
protected
string|null
$region
= null
$regionsNames
protected
static array<string|int, mixed>|null
$regionsNames
= null
$variant
protected
string|null
$variant
= null
Methods
__construct()
public
__construct(string $id) : mixed
Parameters
- $id : string
__toString()
Returns the original locale ID.
public
__toString() : string
Return values
stringall()
Get the list of the known languages.
public
static all() : array<string|int, mixed>
Return values
array<string|int, mixed>getCode()
Returns the code of the locale "en"/"fr".
public
getCode() : string
Return values
stringgetFullIsoDescription()
Get a string with long ISO name, region in parentheses if applicable, variant in parentheses if applicable.
public
getFullIsoDescription() : string
Return values
stringgetFullIsoName()
Returns the long ISO language name.
public
getFullIsoName() : string
Return values
stringgetFullNativeDescription()
Get a string with long native name, region in parentheses if applicable, variant in parentheses if applicable.
public
getFullNativeDescription() : string
Return values
stringgetFullNativeName()
Return the full name of the language in this language.
public
getFullNativeName() : string
Return values
stringgetId()
Returns the original locale ID.
public
getId() : string
Return values
stringgetIsoDescription()
Get a string with short ISO name, region in parentheses if applicable, variant in parentheses if applicable.
public
getIsoDescription() : string
Return values
stringgetIsoName()
Returns the short ISO language name.
public
getIsoName() : string
Return values
stringgetNames()
Get both isoName and nativeName as an array.
public
getNames() : array<string|int, mixed>
Return values
array<string|int, mixed>getNativeDescription()
Get a string with short native name, region in parentheses if applicable, variant in parentheses if applicable.
public
getNativeDescription() : string
Return values
stringgetNativeName()
Get the short name of the language in this language.
public
getNativeName() : string
Return values
stringgetRegion()
Returns the region part of the locale.
public
getRegion() : string|null
Return values
string|nullgetRegionName()
Returns the region name for the current language.
public
getRegionName() : string|null
⚠ ISO 3166-2 short name provided with no warranty, should not be used for any purpose to show official state names.
Return values
string|nullgetVariant()
Returns the variant code such as cyrl/latn.
public
getVariant() : string|null
Return values
string|nullgetVariantName()
Returns the variant such as Cyrillic/Latin.
public
getVariantName() : string|null
Return values
string|nulljsonSerialize()
Get a string with short ISO name, region in parentheses if applicable, variant in parentheses if applicable.
public
jsonSerialize() : string
Return values
stringregions()
Get the list of the known regions.
public
static regions() : array<string|int, mixed>
⚠ ISO 3166-2 short name provided with no warranty, should not be used for any purpose to show official state names.
Return values
array<string|int, mixed>setIsoName()
Set the ISO language name.
public
setIsoName(string $isoName) : static
Parameters
- $isoName : string
Return values
staticsetNativeName()
Set the name of the language in this language.
public
setNativeName(string $nativeName) : static
Parameters
- $nativeName : string