src/EventListener/RenderItemListListener.php
private function translateLabel($transString, $definitionName, array $parameters = []): string
    {
        $translator = $this->translator;

        $label = $translator->trans($definitionName . '.' . $transString, $parameters, 'contao_' . $definitionName);
        if ($label !== $definitionName . '.' . $transString) {
            return $label;
        }

        $label = $translator->trans('MSC.' . $transString, $parameters, 'contao_default');
        if ($label !== $transString) {
            return $label;
        }

        // Fallback, just return the key as is it.
        return $transString;
    }
private function translateLabel($transString, $definitionName, array $parameters = []): string
    {
        $translator = $this->translator;

        $label = $translator->trans($definitionName . '.' . $transString, $parameters, 'contao_' . $definitionName);
        if ($label !== $definitionName . '.' . $transString) {
            return $label;
        }

        $label = $translator->trans('MSC.' . $transString, $parameters, 'contao_default');
        if ($label !== $transString) {
            return $label;
        }

        // Fallback, just return the key as is it.
        return $transString;
    }
private function translateLabel ( $ transString , $ definitionName , array $ parameters = [ ] ) : string { $ translator = $ this -> translator ; $ label = $ translator -> trans ( $ definitionName . '.' . $ transString , $ parameters , 'contao_' . $ definitionName ) ; if ( $ label !== $ definitionName . '.' . $ transString ) { return $ label ; } $ label = $ translator -> trans ( 'MSC.' . $ transString , $ parameters , 'contao_default' ) ; if ( $ label !== $ transString ) { return $ label ; } // Fallback, just return the key as is it. return $ transString ; }
Get a translated label from the translator.

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

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

@param string $definitionName The data definition of the current item.

@param array  $parameters     The parameters to pass to the translator.

@return string
Get a translated label from the translator .