Neos\Flow\I18n\Locale::__construct PHP Method

__construct() public method

Constructs this locale object
public __construct ( string $localeIdentifier )
$localeIdentifier string A valid locale identifier according to UTS#35
    public function __construct($localeIdentifier)
    {
        if (!is_string($localeIdentifier)) {
            throw new \InvalidArgumentException('A locale identifier must be of type string, ' . gettype($localeIdentifier) . ' given.', 1221216120);
        }
        if (preg_match(self::PATTERN_MATCH_LOCALEIDENTIFIER, $localeIdentifier, $matches) !== 1) {
            throw new Exception\InvalidLocaleIdentifierException('"' . $localeIdentifier . '" is not a valid locale identifier.', 1221137814);
        }
        $this->language = strtolower($matches['language']);
        if (!empty($matches['script'])) {
            $this->script = ucfirst(strtolower($matches['script']));
        }
        if (!empty($matches['region'])) {
            $this->region = strtoupper($matches['region']);
        }
        if (!empty($matches['variant'])) {
            $this->variant = strtoupper($matches['variant']);
        }
    }