processing change active language

@param LanguageListener $listener
@param String $locale
@return RedirectResponse
180786
public function change(LanguageListener $listener, $locale)
    {
        try {
            Session::put('locale', $locale);
            app()->setLocale($locale);
            return $listener->changeSuccess();
        } catch (Exception $e) {
            Log::warning($e);
            return $listener->changeFailed($e->getMessage());
        }
    }
1342286
public function changeAdminLanguageAction(Request $request, $locale)
    {
        $request->getSession()->set('admin/_locale', $locale);

        return new RedirectResponse($request->headers->get('referer'));
    }
877616
private function executeQuery(string $url, string $locale = null): string
    {
        if (null !== $locale) {
            $url = sprintf('%s&accept-language=%s', $url, $locale);
        }

        return $this->getUrlContents($url);
    }
46038
public void setLocale(final Locale locale) {
        if (!equals(this.locale, locale)) {
            this.locale = locale;
            super.setValue(toString(locale));
            i18nBundleProvider.reloadBundles(locale);
        }
    }
795754
public function setActive($locale)
    {
        $active = $this->findByLocale($locale);

        if (!$active) {
            throw new Exception(sprintf("Locale '%s' not in list.", $locale));
        }

        // Mark as current locale
        $this->active = $active;

        // Set as global default for other classes
        \Locale::setDefault($active->getLocale());

        return $this;
    }
333146
public function onSuccess($locale, NodeInterface $node)
    {
        $this->eventDispatcher->dispatch(TadckaTreeEvents::NODE_EDIT_SUCCESS, new TreeNodeEvent($locale, $node));
        $this->textNodeManager->save();

        return $this->translator->trans('success.text_node_save', array(), 'SilvestraTextNodeBundle');
    }
1330973
public function update(LanguageRequest $request, Language $language)
    {
        $language->update($request->all());
        Session::forget('language_setup', false);

        return redirect()->route('admin.language.index');
    }
550949
protected function filterLocale(Locale $locale)
    {
        $language = substr($locale->locale, 0, 2);

        $this->addLocale($locale->locale);
        $this->addLocale($language);
    }
1253315
public function getchangedI18N($locale=null) {
		if(!$locale)
			return array_keys($this->translationschanged);
		elseif(isset($this->translationschanged[$locale]))
			return array_keys($this->translationschanged[$locale]);
		else
			return [];
	}
533737
public function setLocale(Locale $locale)
    {
        putenv('LANG='.$locale);
        setlocale(LC_ALL, [$locale.'.utf8', $locale]);
        $this->curLocale = $locale;
        $this->sessionSegment->set('locale', $locale);
    }
28080
public function edit(UserUpdaterListener $listener, $id)
    {
        $eloquent = Foundation::make('orchestra.user')->findOrFail($id);
        $form = $this->presenter->form($eloquent, 'update');

        $this->fireEvent('form', [$eloquent, $form]);

        return $listener->showUserChanger(\compact('eloquent', 'form'));
    }
85499
public function setLocale($locale)
    {
        $this->locale = LanguageNormalize::toLanguageTag($locale);

        $this->localises[$locale] = null;

        return $this;
    }
955557
public static function localeHasDiffOneDayWords($locale)
    {
        return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) {
            return $newLocale &&
                $translator->trans('diff_now') !== 'diff_now' &&
                $translator->trans('diff_yesterday') !== 'diff_yesterday' &&
                $translator->trans('diff_tomorrow') !== 'diff_tomorrow';
        });
    }
1190913
public function setLocale($locale)
    {
        /** @var Config $config */
        $config = $this->get('config');
        $config->set('app.locale.selected', $locale);

        /** @noinspection PhpUndefinedMethodInspection */
        $this->get('translator')->setLocale($locale);
    }
165937
function i18n($file, $locale = NULL){
        $this->fileName= $file;
        $this->i18nContent= NULL;
        if($locale != NULL){
            if(file_exists(PATHAPP . 'src/content/' . $file . "_$locale" . '.txt')){
                $this->i18nContent= \E_fn\load_application_file('src/content/' . $file . "_$locale" . '.txt');
                $this->i18nContent= \E_fn\parse_properties($this->i18nContent);
                $this->locale= $locale;
            }
        }
        if($this->i18nContent == NULL){
            $this->i18nContent= \E_fn\load_application_file('src/content/' . $file . '.txt');
            $this->i18nContent= \E_fn\parse_properties($this->i18nContent);
            $this->locale= 'Default';
        }
    }
1342529
public function setPjaxRequestLocale(GetResponseEvent $event)
    {
        $request = $event->getRequest();

        if (!$event->isMasterRequest() || !$this->requestMatcher->matches($request)) {
            return;
        }

        $request->setLocale($request->getPreferredLanguage());
        $request->attributes->set('_locale', $request->getPreferredLanguage());
    }
1232790
protected function callListenerBindings(Listener $listener, Event $event)
    {
        $binding = $listener->determineEventBinding($event);

        if ($listener->hasBinding($binding)) {
            foreach ($listener->getBindings($binding) as $callback) {
                $resource = $event->getResource();

                call_user_func($callback, $resource, $resource->getPath());
            }
        }

        // If a listener has a binding for anything we'll also spin through
        // them and call each of them.
        if ($listener->hasBinding('*')) {
            foreach ($listener->getBindings('*') as $callback) {
                $resource = $event->getResource();

                call_user_func($callback, $event, $resource, $resource->getPath());
            }
        }
    }