PHP Class Neos\Flow\I18n\Locale
Objects of this kind conveniently represent locales usually described by
locale identifiers such as de_DE, en_Latin_US etc. The locale identifiers
used are defined in the Unicode Technical Standard #35 (Unicode Locale
Data Markup Language).
Using this class asserts the validity of the used locale and provides you
with some useful methods for getting more information about it.
Please note that this class represents locale identifier with valid syntax,
but it does not assures that represented locale is available (installed) in
current Flow installation. In order to check that, various methods of
\Neos\Flow\I18n\Service class can be used.
Show file
Open project: neos/flow-development-collection
Class Usage Examples
Protected Properties
Property |
Type |
Description |
|
$language |
string |
The language identifier - a BCP47, ISO 639-3 or 639-5 code
Like the standard says, we use "mul" to label multilanguage content |
|
$region |
string |
The region identifier - an ISO 3166-1-alpha-2 code or a UN M.49 three digit code
Note: We use "ZZ" for "unknown region" or "global" |
|
$script |
string |
The script identifier - an ISO 15924 code according to BCP47 |
|
$variant |
string |
The optional variant identifier - one of the registered registered variants according to BCP47 |
|
Public Methods
Method Details
__construct()
public method
Constructs this locale object
public __construct ( string $localeIdentifier ) |
$localeIdentifier |
string |
A valid locale identifier according to UTS#35 |
__toString()
public method
Returns the string identifier of this locale
getLanguage()
public method
Returns the language defined in this locale
getRegion()
public method
Returns the region defined in this locale
getScript()
public method
Returns the script defined in this locale
getVariant()
public method
Returns the variant defined in this locale
Property Details
$language protected property
The language identifier - a BCP47, ISO 639-3 or 639-5 code
Like the standard says, we use "mul" to label multilanguage content
protected string $language |
return |
string |
|
$region protected property
The region identifier - an ISO 3166-1-alpha-2 code or a UN M.49 three digit code
Note: We use "ZZ" for "unknown region" or "global"
protected string $region |
return |
string |
|
$script protected property
The script identifier - an ISO 15924 code according to BCP47
protected string $script |
return |
string |
|
$variant protected property
The optional variant identifier - one of the registered registered variants according to BCP47
protected string $variant |
return |
string |
|