private function checkLanguageSubmit($environment, $languages)
    {
        $inputProvider = $environment->getInputProvider();

        if ('language_switch' !== $inputProvider->getValue('FORM_SUBMIT')) {
            return;
        }

        // Get/Check the new language.
        if ($inputProvider->hasValue('language')
            && \array_key_exists($inputProvider->getValue('language'), $languages)
        ) {
            $session['ml_support'][$environment->getDataDefinition()->getName()] = $inputProvider->getValue('language');
            $environment->getSessionStorage()->set('dc_general', $session);
        }

        $environment->getEventDispatcher()->dispatch(ContaoEvents::CONTROLLER_RELOAD, new ReloadEvent());
    }