protected function setActiveLanguage($language)
    {
        $languages = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageIds();
        $languageId = array_search($language, $languages);
        if ($languageId === false) {
            throw new Exception("Language $language was not found or is not active in shop");
        }
        \OxidEsales\Eshop\Core\Registry::getLang()->setBaseLanguage($languageId);
    }