PHP Класс 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.
См. также: http://www.unicode.org/reports/tr35/
См. также: Neos\Flow\I18n\Service
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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

Открытые методы

Метод Описание
__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

Описание методов

__construct() публичный Метод

Constructs this locale object
public __construct ( string $localeIdentifier )
$localeIdentifier string A valid locale identifier according to UTS#35

__toString() публичный Метод

Returns the string identifier of this locale
public __toString ( ) : string
Результат string The locale identifier (tag)

getLanguage() публичный Метод

Returns the language defined in this locale
public getLanguage ( ) : string
Результат string The language identifier

getRegion() публичный Метод

Returns the region defined in this locale
public getRegion ( ) : string
Результат string The region identifier

getScript() публичный Метод

Returns the script defined in this locale
public getScript ( ) : string
Результат string The script identifier

getVariant() публичный Метод

Returns the variant defined in this locale
public getVariant ( ) : string
Результат string The variant identifier

Описание свойств

$language защищенное свойство

The language identifier - a BCP47, ISO 639-3 or 639-5 code Like the standard says, we use "mul" to label multilanguage content
См. также: http://rfc.net/bcp47.html
См. также: http://en.wikipedia.org/wiki/ISO_639
protected string $language
Результат string

$region защищенное свойство

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"
См. также: http://www.iso.org/iso/country_codes/iso_3166_code_lists.htm
См. также: http://en.wikipedia.org/wiki/UN_M.49
protected string $region
Результат string

$script защищенное свойство

The script identifier - an ISO 15924 code according to BCP47
См. также: http://rfc.net/bcp47.html
См. также: http://unicode.org/iso15924/iso15924-codes.html
protected string $script
Результат string

$variant защищенное свойство

The optional variant identifier - one of the registered registered variants according to BCP47
См. также: http://rfc.net/bcp47.html
protected string $variant
Результат string