public function setTplLanguage($iLang = null)
    {
        $this->_iTplLanguageId = isset($iLang) ? (int) $iLang : $this->getBaseLanguage();
        if ($this->isAdmin()) {
            $aLanguages = $this->getAdminTplLanguageArray();
            if (!isset($aLanguages[$this->_iTplLanguageId])) {
                $this->_iTplLanguageId = key($aLanguages);
            }
        }

        \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('tpllanguage', $this->_iTplLanguageId);

        return $this->_iTplLanguageId;
    }