src/Contao/View/Contao2BackendView/EditMask.php
protected function getButtonLabel($buttonLabel)
    {
        $translator = $this->getEnvironment()->getTranslator();
        if (($label = $translator->translate($buttonLabel, $this->getDataDefinition()->getName())) !== $buttonLabel) {
            return $label;
        }

        if (($label = $translator->translate('MSC.' . $buttonLabel)) !== $buttonLabel) {
            return $label;
        }

        // Fallback, just return the key as is it.
        return $buttonLabel;
    }
protected function getButtonLabel($buttonLabel)
    {
        $translator = $this->getEnvironment()->getTranslator();
        if (($label = $translator->translate($buttonLabel, $this->getDataDefinition()->getName())) !== $buttonLabel) {
            return $label;
        }

        if (($label = $translator->translate('MSC.' . $buttonLabel)) !== $buttonLabel) {
            return $label;
        }

        // Fallback, just return the key as is it.
        return $buttonLabel;
    }
protected function getButtonLabel ( $ buttonLabel ) { $ translator = $ this -> getEnvironment ( ) -> getTranslator ( ) ; if ( ( $ label = $ translator -> translate ( $ buttonLabel , $ this -> getDataDefinition ( ) -> getName ( ) ) ) !== $ buttonLabel ) { return $ label ; } if ( ( $ label = $ translator -> translate ( 'MSC.' . $ buttonLabel ) ) !== $ buttonLabel ) { return $ label ; } // Fallback, just return the key as is it. return $ buttonLabel ; }
Get the label for a button from the translator.

The fallback is as follows:
1. Try to translate the button via the data definition name as translation section.
2. Try to translate the button name with the prefix 'MSC.'.
3. Return the input value as nothing worked out.

@param string $buttonLabel The non translated label for the button.

@return string
Get the label for a button from the translator .