Neos\Flow\I18n\Cldr\Reader\DatesReader::parseLocalizedLiterals PHP Method

parseLocalizedLiterals() protected method

Many children of "dates" node have common structure, so one method can be used to parse them all.
protected parseLocalizedLiterals ( CldrModel $model, string $literalType ) : array
$model Neos\Flow\I18n\Cldr\CldrModel CldrModel to read data from
$literalType string One of: month, day, quarter, dayPeriod
return array An array with localized literals for given type
    protected function parseLocalizedLiterals(CldrModel $model, $literalType)
    {
        $data = [];
        $context = $model->getRawArray('dates/calendars/calendar[@type="gregorian"]/' . $literalType . 's');
        foreach ($context as $contextNodeString => $literalsWidths) {
            $contextType = $model->getAttributeValue($contextNodeString, 'type');
            if (!is_array($literalsWidths)) {
                continue;
            }
            foreach ($literalsWidths as $widthNodeString => $literals) {
                $widthType = $model->getAttributeValue($widthNodeString, 'type');
                if (!is_array($literals)) {
                    continue;
                }
                foreach ($literals as $literalNodeString => $literalValue) {
                    $literalName = $model->getAttributeValue($literalNodeString, 'type');
                    $data[$contextType][$widthType][$literalName] = $literalValue;
                }
            }
        }
        return $data;
    }