code: protected function setLanguage($language = '')
      {
          $previousLanguage = $GLOBALS['TL_LANGUAGE'];
          if (!empty($language) && ($GLOBALS['TL_LANGUAGE'] !== $language)) {
              $GLOBALS['TL_LANGUAGE'] = $language;
          }
  
          return $previousLanguage;
      }
docs: 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)