Restores the previous language as the current language.

@return void

@since 1.0.0
@api
494749
public function popLanguage(): void
  {
    array_pop($this->stack);
    $this->language = $this->stack[count($this->stack) - 1];
  }
1127669
public function cmdUpdateLanguage()
    {
        $params = $this->getParam();

        if (empty($params[0]) || count($params) < 2) {
            $this->errorAndExit($this->text('Invalid command'));
        }

        $this->setSubmitted(null, $params);
        $this->setSubmitted('update', $params[0]);
        $this->validateComponent('language');

        $this->updateLanguage($params[0]);
        $this->output();
    }
436817
protected function deleteLanguage()
    {
        $this->controlAccess('language_delete');

        if ($this->language->delete($this->data_language['code'])) {
            $this->redirect('admin/settings/language', $this->text('Language has been deleted'), 'success');
        }

        $this->redirect('', $this->text('Language has not been deleted'), 'warning');
    }
400626
protected function _rebuildLanguageStringsFiles()
    {
        $db_filepath = $this->getLoader()->buildLanguageDBFilePath();
        $generator = new Generator($db_filepath);
        $generator->generate();
        return $this;
    }
712518
private function setLanguageFromBrowser(): void
    {
        $userLang = App::$Properties->get('singleLanguage');
        $browserAccept = $this->getLanguages();
        if (Any::isArray($browserAccept) && count($browserAccept) > 0) {
            foreach ($browserAccept as $bLang) {
                if (Arr::in($bLang, App::$Properties->get('languages'))) {
                    $userLang = $bLang;
                    break; // stop calculating, language is founded in priority
                }
            }
        }

        // parse query string
        $queryString = null;
        if (count($this->query->all()) > 0) {
            $queryString = '?' . http_build_query($this->query->all());
        }

        // build response with redirect to language-based path
        $redirectUrl = $this->getSchemeAndHttpHost() . $this->basePath . '/' . $userLang . $this->getPathInfo() . $queryString;
        $response = new RedirectResponse($redirectUrl);
        $response->send();
        exit();
    }
1009129
protected function reset()
    {
        $this->number = null;
        $this->domain = null;
        $this->locale = null;
    }
803356
public function saveLanguage()
    {
        if (DbHelper::isInstalled()) {
            $this->checkTokenInUrl();
        }
        $language = $this->getParam('language');
        LanguagesManager::setLanguageForSession($language);
        Url::redirectToReferrer();
    }
866908
public static function getCurrentLanguage(){
		if(!self::$current_language){
			$language = CSession::get(self::CURRENT_LANGUAGE);
			if(!$language){
				$language = 'en_US';
			}
			self::$current_language = $language;
		}
		return self::$current_language;
	}
1272965
function setLanguage () {
		if (!defined('LANGUAGES')){
			define('LANGUAGES', 'en');
		}	
		$this->i18nURL();
		if (!defined('LANG')){
			if (!$this->lang){
				$this->lang = 'en';
			}
			define('LANG', $this->lang);
		}
	}
369670
protected function validateLanguage()
    {
        $this->setSubmitted('language');
        $this->setSubmittedBool('status');
        $this->setSubmittedBool('default');
        $this->setSubmitted('update', $this->data_language);

        $this->validateComponent('language');

        return !$this->hasErrors();
    }
855229
public function currentLocale()
    {
        $langCode = $this->translator()->getLocale();
        $locales  = $this->translator()->locales();
        if (isset($locales[$langCode])) {
            $locale = $locales[$langCode];
            if (isset($locale['locale'])) {
                return $locale['locale'];
            } else {
                return $langCode;
            }
        }

        return null;
    }
523124
public function restore()
    {
        $types = [
            'javascript',
            'css',
            'customScript',
            'customCSS',
            'customHeadTags',
            'combinedFiles',
        ];
        foreach ($types as $type) {
            $this->{$type} = $this->disabled[$type];
        }
    }
1181295
public function saveTranslation()
    {
        $ret = true;

        foreach ($this->_models as $language => $model) {
            $dirty = $model->getDirtyAttributes();
            // we do not need to save anything, if nothing has changed or translation is equal to its fallback
            if (empty($dirty) || ($this->skipSavingDuplicateTranslation && $model->isNewRecord && $this->modelEqualsFallbackTranslation($model, $language))) {
                continue;
            }
            /** @var \yii\db\ActiveQuery $relation */
            $relation = $this->owner->getRelation($this->relation);
            $pks = $relation->link;

            foreach ($pks as $fk => $pk) {
                $model->$fk = $this->owner->$pk;
            }

            if (!$model->save()) {
                $ret = false;
            }
        }

        return $ret;
    }
1353366
public function reset()
    {
        $this->_position = 0;

        if ($this->_input === null) {
            return;
        }

        // convert input into ascii
        if (PHP_OS != 'AIX') {
            $this->_input = iconv($this->_encoding, 'ASCII//TRANSLIT', $this->_input);
        }
        $this->_encoding = 'ASCII';
    }
1148235
public function saveLanguage()
    {
        $language = Common::getRequestVar('language');

        // Prevent CSRF only when piwik is not installed yet (During install user can change language)
        if (DbHelper::isInstalled()) {
            $this->checkTokenInUrl();
        }

        LanguagesManager::setLanguageForSession($language);
        Url::redirectToReferrer();
    }
505812
protected function refreshLanguage()
    {
        $this->controlToken('refresh');

        $code = $this->getQuery('refresh');
        if (!empty($code) && $this->access('language_edit') && $this->translation->refresh($code)) {
            $this->redirect('', $this->text('Language has been refreshed'), 'success');
        }
    }
1287124
public function listLanguage()
    {
        $this->refreshLanguage();
        $this->setTitleListLanguage();
        $this->setBreadcrumbListLanguage();
        $this->setFilterListLanguage();
        $this->setPagerListLanguage();

        $this->setData('languages', (array) $this->getListLanguage());
        $this->outputListLanguage();
    }