Resets all multilanguage fields with specific language id
to default value in all tables.

@param string $iLangId language ID
513620
protected function _resetMultiLangDbFields($iLangId)
    {
        $iLangId = (int) $iLangId;

        //skipping reseting language with id = 0
        if ($iLangId) {
            \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->startTransaction();

            try {
                $oDbMeta = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class);
                $oDbMeta->resetLanguage($iLangId);

                \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->commitTransaction();
            } catch (Exception $oEx) {
                // if exception, rollBack everything
                \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->rollbackTransaction();

                //show warning
                $oEx = oxNew(\OxidEsales\Eshop\Core\Exception\ExceptionToDisplay::class);
                $oEx->setMessage('LANGUAGE_ERROR_RESETING_MULTILANG_FIELDS');
                \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($oEx);
            }
        }
    }
401826
public function setLanguage(int $lanId): void
  {
    $this->language                               = Abc::$DL->abcBabelCoreLanguageGetDetails($lanId);
    $this->stack[max(0, count($this->stack) - 1)] = $this->language;
  }
1076345
public function setLanguageId($langid)
	{
		if ( $langid === $this->getLanguageId() ) { return; }

		$this->_values['langid'] = strtolower( (string) $langid );
		$this->setModified();
	}
159042
@Override
  public final void setLang(final Languages pLang) {
    this.lang = pLang;
    if (this.itsId == null) {
      this.itsId = new IdI18nServiceToSale();
    }
    this.itsId.setLang(this.lang);
  }
1329391
protected function initLanguages()
    {
        $this->languageIdList[0] = 0;

        $query      = 'SELECT uid
                         FROM sys_language
                        WHERE hidden = 0';
        $langIdList = DatabaseUtility::getColWithIndex($query);

        $this->languageIdList = $langIdList;
    }
176648
private function reset()
	{
		// Reset the syntax element
		$syntax       = '\\Hubzero\\Database\\Syntax\\' . ucfirst($this->connection->getSyntax());
		$this->syntax = new $syntax($this->connection);
	}
422551
public function validateLanguage($iLang = null)
    {
        // checking if this language is valid
        $aLanguages = $this->getLanguageArray(null, !$this->isAdmin());
        if (!isset($aLanguages[$iLang]) && is_array($aLanguages)) {
            $oLang = current($aLanguages);
            if (isset($oLang->id)) {
                $iLang = $oLang->id;
            }
        }

        return (int) $iLang;
    }
707115
private function reset() : void
    {
        $this->id = null;
        $this->data = [];
        $this->inRequest = false;
    }
869256
public static function setLanguage($lang)
    {
        Application::$instance->i18n->setLanguage($lang);
        \Config::set('i18n.language', $lang);
    }
603074
public function resetMultilangFields($langId, $tableName)
    {
        $langId = (int) $langId;

        if ($langId === 0) {
            return;
        }

        $sql = [];

        $fields = $this->getMultilangFields($tableName);
        if (is_array($fields) && count($fields) > 0) {
            foreach ($fields as $fieldName) {
                $fieldName = $fieldName . "_" . $langId;

                if ($this->fieldExists($fieldName, $tableName)) {
                    //resetting field value to default
                    $sql[] = "UPDATE {$tableName} SET {$fieldName} = DEFAULT;";
                }
            }
        }

        if (!empty($sql)) {
            $this->executeSql($sql);
        }
    }
1163506
@Override
  public final void setLang(final Languages pLang) {
    this.lang = pLang;
    if (this.itsId == null) {
      this.itsId = new IdI18nCatalogGs();
    }
    this.itsId.setLang(this.lang);
  }
435109
protected function populateLanguageIDs() {
        $this->_cache_language_ids=array();
        if($snippetLanguages=$this->snippetLanguagesIncluded()) {
            // And keep a record of parents we don't need to get
            // parents of themselves, as well as IDs to mark
            foreach($snippetLanguages as $langId) {
                $this->_cache_language_ids[$langId]=true;
            }
        }
    }
1009129
protected function reset()
    {
        $this->number = null;
        $this->domain = null;
        $this->locale = null;
    }
1206477
protected function resetLang($force = false)
    {
        if ($this->autoResetLang || $force) {
            $this->lang = null;
        }

        return $this;
    }
702209
public function reset()
    {
        // Remove all rules and messages
        $this->rules = [];
        $this->messages = ['rules' => [], 'custom' => []];
        $this->clear();

        // Add the initial rules and messages
        Validate::addRuleSet($this);
        $this->setLanguage($this->lang, $this->langDir);

        return $this;
    }
1234881
public function resetForLocaleTranslatables(LocaleEntity $locale, $translatables)
    {
        $this->resetForLocale($locale);
        $translatableIDs = [];
        if ($translatables) {
            if ($translatables instanceof TranslatableEntity) {
                $translatableIDs[] = $translatables->getID();
            } elseif (is_int($translatables)) {
                $translatableIDs[] = $translatables;
            } elseif (is_array($translatables)) {
                foreach ($translatables as $translatable) {
                    if ($translatable instanceof TranslatableEntity) {
                        $translatableIDs[] = $translatable->getID();
                    } elseif (is_int($translatable)) {
                        $translatableIDs[] = $translatable;
                    } else {
                        throw new UserMessageException(t('Invalid translatable string specified'));
                    }
                }
            }
        }
        if (empty($translatableIDs)) {
            throw new UserMessageException(t('Invalid translatable string specified'));
        }
        $this->getEntityManager()->getConnection()->executeQuery(
            '
                delete s.*
                from CommunityTranslationStats as s
                inner join CommunityTranslationTranslatablePlaces as p on s.packageVersion = p.packageVersion
                where s.locale = ?
                and (p.translatable = ' . implode(' or p.translatable = ', $translatableIDs) . ')
            ',
            [$locale->getID()]
        );
    }
1029415
protected function resetInternal()
    {
        $this->xmlDocument = new DOMDocument();
        $this->xmlDocument->preserveWhiteSpace = false;
        $this->xmlDocument->strictErrorChecking = false;
        $this->xmlDocument->formatOutput = !$this->minifyXML;
    }