public function translateProperty(AbstractRenderable $element, string $property): string
    {
        if ($property === 'label') {
            $defaultValue = $element->getLabel();
            if ($defaultValue === null) {
                $defaultValue = '';
            }
        } elseif ($element instanceof FormElementInterface) {
            $defaultValue = isset($element->getProperties()[$property]) ? (string)$element->getProperties()[$property] : '';
        } else {
            $defaultValue = '';
        }
        $translationId = sprintf('forms.elements.%s.%s', $element->getIdentifier(), $property);
        return $this->translate($element, $translationId, $defaultValue);
    }
public function translateProperty(AbstractRenderable $element, string $property): string
    {
        if ($property === 'label') {
            $defaultValue = $element->getLabel();
            if ($defaultValue === null) {
                $defaultValue = '';
            }
        } elseif ($element instanceof FormElementInterface) {
            $defaultValue = isset($element->getProperties()[$property]) ? (string)$element->getProperties()[$property] : '';
        } else {
            $defaultValue = '';
        }
        $translationId = sprintf('forms.elements.%s.%s', $element->getIdentifier(), $property);
        return $this->translate($element, $translationId, $defaultValue);
    }
public function translateProperty ( AbstractRenderable $ element , string $ property ) : string { if ( $ property === 'label' ) { $ defaultValue = $ element -> getLabel ( ) ; if ( $ defaultValue === null ) { $ defaultValue = '' ; } } elseif ( $ element instanceof FormElementInterface ) { $ defaultValue = isset ( $ element -> getProperties ( ) [ $ property ] ) ? ( string ) $ element -> getProperties ( ) [ $ property ] : '' ; } else { $ defaultValue = '' ; } $ translationId = sprintf ( 'forms.elements.%s.%s' , $ element -> getIdentifier ( ) , $ property ) ; return $ this -> translate ( $ element , $ translationId , $ defaultValue ) ; }
Translates the property of a given Form Element

@param AbstractRenderable $element
@param string $property
@return string
Translates the property of a given Form Element