protected function validateInput($locale = null)
    {
        // check for valid locale
        if ($locale && !$this->isValidLocale($locale)) {
            throw new Doozr_I18n_Service_Exception(
                sprintf('Invalid locale: %s', $locale)
            );
        }

        // get concrete locale
        $locale = ($locale !== null) ? $locale : $this->getClientPreferredLocale();

        $config = $this->getL10nConfigurationByLocale($locale);

        // check for redirect of current locale (e.g. from "en-gb" -> "en")
        try {
            $redirectLocale = $config->redirect->target;
            $this->locale   = $redirectLocale;
        } catch (Whoops\Exception\ErrorException $e) {
            $redirectLocale = null;
        } catch (Exception $e) {
            $redirectLocale = null;
        }

        // return a valid set of locale, redirect locale and the configuration
        return [
            'locale'   => $locale,
            'redirect' => $redirectLocale,
            'configuration'   => $config,
        ];
    }