public function setLabels()
    {
        $template = $this->getTemplate();
        try {
            $labels = $template->getLabelMarkerNames();
        } catch (Exception $exception) {
            $labels = [];
        }

        foreach ($labels as $label) {
            $template->setMarker($label, $this->translate($label));
        }
    }
public function setLabels()
    {
        $template = $this->getTemplate();
        try {
            $labels = $template->getLabelMarkerNames();
        } catch (Exception $exception) {
            $labels = [];
        }

        foreach ($labels as $label) {
            $template->setMarker($label, $this->translate($label));
        }
    }
public function setLabels ( ) { $ template = $ this -> getTemplate ( ) ; try { $ labels = $ template -> getLabelMarkerNames ( ) ; } catch ( Exception $ exception ) { $ labels = [ ] ; } foreach ( $ labels as $ label ) { $ template -> setMarker ( $ label , $ this -> translate ( $ label ) ) ; } }
Writes all localized labels for the current template into their
corresponding template markers.

For this, the label markers in the template must be prefixed with
"LABEL_" (e.g. "###LABEL_FOO###"), and the corresponding localization
entry must have the same key, but lowercased and without the ###
(e.g. "label_foo").

@return void
Writes all localized labels for the current template into their corresponding template markers .