protected function getPropertyLabel(EnvironmentInterface $environment, PropertyInterface $property)
    {
        $translator = $environment->getTranslator();

        $label = $translator->translate($property->getLabel(), $environment->getDataDefinition()->getName());
        if (!$label) {
            $label = $translator->translate('MSC.' . $property->getName());
        }

        if (\is_array($label)) {
            $label = $label[0];
        }

        if (!$label) {
            $label = $property->getName();
        }

        return $label;
    }