private function getFromGlobals(string $id): ?string
    {
        // Split the ID into chunks allowing escaped dots (\.) and backslashes (\\)
        preg_match_all('/(?:\\\\[\.\\\\]|[^\.])++/', $id, $matches);
        $parts = preg_replace('/\\\\([\.\\\\])/', '$1', $matches[0]);

        $item = &$GLOBALS['TL_LANG'];

        foreach ($parts as $part) {
            if (!isset($item[$part])) {
                return null;
            }

            $item = &$item[$part];
        }

        return $item;
    }
private function getFromGlobals(string $id): ?string
    {
        
        preg_match_all('/(?:\\\\[\.\\\\]|[^\.])++/', $id, $matches);
        $parts = preg_replace('/\\\\([\.\\\\])/', '$1', $matches[0]);

        $item = &$GLOBALS['TL_LANG'];

        foreach ($parts as $part) {
            if (!isset($item[$part])) {
                return null;
            }

            $item = &$item[$part];
        }

        return $item;
    }
private function getFromGlobals ( string $ id ) : ? string { // Split the ID into chunks allowing escaped dots (\.) and backslashes (\\) preg_match_all ( '/(?:\\\\[\.\\\\]|[^\.])++/' , $ id , $ matches ) ; $ parts = preg_replace ( '/\\\\([\.\\\\])/' , '$1' , $ matches [ 0 ] ) ; $ item = & $ GLOBALS [ 'TL_LANG' ] ; foreach ( $ parts as $ part ) { if ( ! isset ( $ item [ $ part ] ) ) { return null ; } $ item = & $ item [ $ part ] ; } return $ item ; }
Returns the labels from $GLOBALS['TL_LANG'] based on a message ID like "MSC.view".
Returns the labels from $GLOBALS [ TL_LANG ] based on a message ID like MSC . view .