src/DcGeneral/Data/Driver.php
protected function setLanguage($language = '')
    {
        $previousLanguage = $GLOBALS['TL_LANGUAGE'];
        if (!empty($language) && ($GLOBALS['TL_LANGUAGE'] !== $language)) {
            $GLOBALS['TL_LANGUAGE'] = $language;
        }

        return $previousLanguage;
    }
protected function setLanguage($language = '')
    {
        $previousLanguage = $GLOBALS['TL_LANGUAGE'];
        if (!empty($language) && ($GLOBALS['TL_LANGUAGE'] !== $language)) {
            $GLOBALS['TL_LANGUAGE'] = $language;
        }

        return $previousLanguage;
    }
Set a language as active language in Contao and return the previous language.

@param string $language The language to set (if any).

@return string

@SuppressWarnings(PHPMD.Superglobals)
@SuppressWarnings(PHPMD.CamelCaseVariableName)