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.
See also: http://www.unicode.org/reports/tr35/
See also: Neos\Flow\I18n\Service
Datei anzeigen 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 Description
__construct ( string $localeIdentifier ) Constructs this locale object
__toString ( ) : string Returns the string identifier of this locale
getLanguage ( ) : string Returns the language defined in this locale
getRegion ( ) : string Returns the region defined in this locale
getScript ( ) : string Returns the script defined in this locale
getVariant ( ) : string Returns the variant defined in this locale

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
public __toString ( ) : string
return string The locale identifier (tag)

getLanguage() public method

Returns the language defined in this locale
public getLanguage ( ) : string
return string The language identifier

getRegion() public method

Returns the region defined in this locale
public getRegion ( ) : string
return string The region identifier

getScript() public method

Returns the script defined in this locale
public getScript ( ) : string
return string The script identifier

getVariant() public method

Returns the variant defined in this locale
public getVariant ( ) : string
return string The variant identifier

Property Details

$language protected_oe property

The language identifier - a BCP47, ISO 639-3 or 639-5 code Like the standard says, we use "mul" to label multilanguage content
See also: http://rfc.net/bcp47.html
See also: http://en.wikipedia.org/wiki/ISO_639
protected string $language
return string

$region protected_oe 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"
See also: http://www.iso.org/iso/country_codes/iso_3166_code_lists.htm
See also: http://en.wikipedia.org/wiki/UN_M.49
protected string $region
return string

$script protected_oe property

The script identifier - an ISO 15924 code according to BCP47
See also: http://rfc.net/bcp47.html
See also: http://unicode.org/iso15924/iso15924-codes.html
protected string $script
return string

$variant protected_oe property

The optional variant identifier - one of the registered registered variants according to BCP47
See also: http://rfc.net/bcp47.html
protected string $variant
return string