Set the locale associated to the 'site' localization context.

@param Page $c The page to be used to determine the site locale (if null we'll use the current page)
518425
public function setupSiteInterfaceLocalization(Page $c = null)
    {
        $app = Facade::getFacadeApplication();
        $loc = $app->make(Localization::class);
        $locale = null;
        if ($c === null) {
            $c = Page::getCurrentPage();
        }
        if ($c) {
            $pageController = $c->getPageController();
            if (is_callable([$pageController, 'useUserLocale'])) {
                $useUserLocale = $pageController->useUserLocale();
            } else {
                $dh = $app->make('helper/concrete/dashboard');
                $useUserLocale = $dh->inDashboard($c);
            }
            if ($useUserLocale) {
                $u = new User();
                $locale = $u->getUserLanguageToDisplay();
            } else {
                if ($this->isEnabled()) {
                    $ms = Section::getBySectionOfSite($c);
                    if (!$ms) {
                        $ms = static::getPreferredSection();
                    }
                    if ($ms) {
                        $locale = $ms->getLocale();

                        if ($this->canSetSessionValue()) {
                            $app->make('session')->set('multilingual_default_locale', $locale);
                        }
                    }
                }
                if (!$locale) {
                    $siteTree = $c->getSiteTreeObject();
                    if ($siteTree) {
                        $locale = $siteTree->getLocale()->getLocale();
                    }
                }
            }
        }
        if (!$locale) {
            $locale = $app->make('config')->get('concrete.locale');
        }
        $loc->setContextLocale(Localization::CONTEXT_SITE, $locale);
    }
721835
private function pageLocalizationChange(PageLocalization $localization, $force = false)
	{
		$master = $localization->getMaster();
		$pageLocalizationEntity = PageLocalization::CN();

		$dql = "SELECT l FROM $pageLocalizationEntity l JOIN l.master m
				WHERE m.left >= :left
				AND m.right <= :right
				AND l.locale = :locale
				ORDER BY m.left";

		$pageLocalizations = $this->em->createQuery($dql)
				->setParameters(array(
					'left' => $master->getLeftValue(),
					'right' => $master->getRightValue(),
					'locale' => $localization->getLocale(),
				))
				->getResult();

		foreach (array($localization) as $pageLocalization) {
			$this->generatePath($pageLocalization, $force);
		}
	}
1110718
protected function _setCurrentListPosition($page = null)
    {
        $adminListSize = $this->_getViewListSize();

        $jumpToPage = $page ? ((int)$page) : ((int)((int)\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('lstrt')) / $adminListSize);
        $jumpToPage = ($page && $jumpToPage) ? ($jumpToPage - 1) : $jumpToPage;

        $jumpToPage = $jumpToPage * $adminListSize;
        if ($jumpToPage < 1) {
            $jumpToPage = 0;
        } elseif ($jumpToPage >= $this->_iListSize) {
            $jumpToPage = floor($this->_iListSize / $adminListSize - 1) * $adminListSize;
        }

        $this->_iCurrListPos = $this->_iOverPos = (int)$jumpToPage;
    }
467334
public function setLocale($locale) {
		$this->locale          = trim($locale);
		$this->primaryLanguage = IntlLocale::getPrimaryLanguage($this->locale);
	}
496046
public void setLocale(final Locale LOCALE) {
        if (null == locale) {
            _locale = LOCALE;
            fireUpdateEvent(REDRAW_EVENT);
        } else {
            locale.set(LOCALE);
        }
    }
1261748
public function setContextLocale($context, $locale)
    {
        if (isset($this->contextLocales[$context]) && $this->contextLocales[$context] == $locale) {
            return;
        }
        $this->contextLocales[$context] = $locale;
        if ($context === $this->activeContext) {
            $this->currentLocaleChanged($locale);
        }
    }
599421
public void setLocale(Object loc) throws JspTagException {
        if (loc == null
                || (loc instanceof String && ((String) loc).length() == 0)) {
            this.locale = null;
        } else if (loc instanceof Locale) {
            this.locale = (Locale) loc;
        } else {
            locale = Util.parseLocale((String) loc);
        }
    }
496443
public function setActiveContext($context)
    {
        $oldLocale = isset($this->activeContext) ? $this->contextLocales[$this->activeContext] : null;
        $this->activeContext = $context;
        if (!isset($this->contextLocales[$context])) {
            $this->setContextLocale($context, static::BASE_LOCALE);
        }
        $newLocale = $this->contextLocales[$context];
        if ($newLocale !== $oldLocale) {
            $this->currentLocaleChanged($newLocale);
        }
    }
1219026
protected function setLocale()
    {
        $locale = $this->app['config']['app.locale'];
        $fallbackLocale = $this->app['config']['app.fallback_locale'];

        Punic::setDefaultLocale($locale);
        Punic::setFallbackLocale($fallbackLocale);
    }
432652
private function setPage($page)
    {
        $this->page = (int)$page;
        $this->offset = ($page - 1) * $this->limit;
    }
1193497
public function setLocale()
    {
        if ($locale = $this->app->session->get('administrator_locale')) {
            $this->app->setLocale($locale);
        }
    }
1308770
public void setLocale(Locale locale) throws CmsException {

        CmsUserSettings settings = getSettings();
        if (settings != null) {
            settings.setLocale(locale);
            settings.save(m_cms);
            m_messages = Messages.get().getBundle(locale);
        }
    }
844348
protected function _setLocale() {
		$language = $this->_language->getCurrentUiLang(false);

		return (bool)setlocale(LC_ALL, $language);
	}
775774
public void setDefaultLocale(String locale) {

        try {
            m_defaultLocale = CmsLocaleManager.getLocale(locale);
        } catch (Exception e) {
            if (CmsLog.INIT.isWarnEnabled()) {
                CmsLog.INIT.warn(Messages.get().getBundle().key(Messages.INIT_NONCRIT_ERROR_0), e);
            }
        }
        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_DEFAULT_LOCALE_1, m_defaultLocale));
        }
    }
983202
protected void setLocale(String strLocale) {
	if (strLocale == null) {
	    this.locale = Locale.US;
	}
	else {
	    try {
		this.locale = Caster.toLocale(strLocale);
		if (this.locale == null) this.locale = Locale.US;
	    }
	    catch (ExpressionException e) {
		this.locale = Locale.US;
	    }
	}
    }
46038
public void setLocale(final Locale locale) {
        if (!equals(this.locale, locale)) {
            this.locale = locale;
            super.setValue(toString(locale));
            i18nBundleProvider.reloadBundles(locale);
        }
    }
917020
private function updateChildrenPageTranslationPath(
        PageInterface $page,
        UnitOfWork $uow,
        ClassMetadata $metadata,
        $from,
        $to,
        $locale
    ) {
        // TODO use url generator or i18n routing prefix strategy
        $localePrefix = $locale != 'fr' ? '/' . $locale : '';
        foreach ($page->getChildren() as $child) {
            $translation = $child->translate($locale);
            $oldPath = $translation->getPath();
            if (0 === strpos($oldPath, $from)) {
                $newPath = str_replace($from, $to, $oldPath);
                $translation->setPath($newPath);
                $uow->recomputeSingleEntityChangeSet($metadata, $translation);

                if (0 < strlen($oldPath) && 0 < strlen($newPath) && $oldPath != $newPath) {
                    $this->redirections[] = array(
                        'from' => $localePrefix . $oldPath,
                        'to'   => $localePrefix . $newPath,
                    );
                }

                // Update the children pages translations paths.
                if ($child->hasChildren()) {
                    $this->updateChildrenPageTranslationPath($child, $uow, $metadata, $oldPath, $newPath, $locale);
                }
            }
        }
    }