Set lang

@param \Core\Entity\Language $lang
@return TranslateMenuPage
10141
public function setLang(\Core\Entity\Language $lang = null)
    {
        $this->lang = $lang;

        return $this;
    }
724684
public function setLanguage(\Core\Entity\Language $language = null) {
        $this->language = $language;

        return $this;
    }
1371911
public function setLanguage($language, $category = null)
    {
        if ($category === null) {
            $category = defined('LC_MESSAGES') ? LC_MESSAGES : LC_ALL;
        }

        setlocale($category, $language);
        putenv('LANGUAGE='.$language);

        return $this;
    }
1249335
protected function setLocale($locale)
    {
        if (is_null($locale) || $locale === 'auto') {
            $locale = app()->getLocale();
        }

        $this->locale = $locale;

        return $this;
    }
823002
public function setLang($lang = 'en-us') {
		$this->lang = $lang;

		try {
			$this->messages = parse_ini_file(__DIR__ . '/Lang/' . $this->lang . '.ini');
		} catch (Exception $e) {
			throw $e;
		}
	}
1104816
public function translation($lang)
    {
        $result = Translation::where('entity_id', $this->id)
            ->where('entity_type', get_class($this))
            ->where('language', $lang)
            ->first();

        if ($result) {
            return $result;
        }

        $this->data = $this;

        return $this;
    }
113679
private function setIfAllowed($lang)
    {
        $allowedLangs = array_keys(Localizer::allowedLanguages());
        if (config('localizer.block_unallowed_langs') && !in_array($lang, $allowedLangs)) {
            $lang = $allowedLangs[0];
        }

        App::setLocale($lang);
        if (config('localizer.carbon')) {
            Carbon::setLocale($lang);
        }
    }
905746
public static function setLang($lang)
    {
        phpCAS::_validateClientExists();

        try {
            self::$_PHPCAS_CLIENT->setLang($lang);
        } catch (Exception $e) {
            phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
        }
    }
950037
protected function setPublicationLanguage($language)
    {
        self::writeFullTag(
            $language,
            'name',
            false,
            'news:language',
            $this->validator,
            'validateLanguage',
            $this->exception,
            'Provided publication language is not a valid value.'
        );

        return $this;
    }
1153112
public function setLanguage($lang = null)
    {
        $this->_iLanguage = (int) $lang;
        // reset
        $this->_sViewTable = false;
    }
289497
public function setFallbackLanguage($language)
    {
        if ( $this->isSupported($language) ) {
            $this->fallbackLanguage = $language;
        }
        else {
            throw new RuntimeException('Variable must be one of the supported languages.');
        }

        return $this;
    }
1278400
public function addTranslation(\Haven\PersonaBundle\Entity\EnterpriseTranslation $translations)
    {
        $translations->setParent($this);
        $this->translations[] = $translations;

        return $this;
    }
676597
public function setCurrentLocale($lang)
    {
        if ($lang === null) {
            $this->currentLanguage = null;
            return;
        }

        if (!$this->hasLocale($lang)) {
            if (!is_string($lang)) {
                $lang = is_object($lang) ? get_class($lang) : gettype($lang);
            }

            throw new InvalidArgumentException(sprintf(
                'Unsupported language; must be one of "%s", received "%s"',
                implode(', ', $this->availableLocales()),
                $lang
            ));
        }

        $this->currentLanguage = $lang;
    }
203793
public static function languageToTerritory($lang) {
        $config = Zend_Registry::get('config');
        $territory = isset($config->resources->locale->territories->{$lang}) ?
            $config->resources->locale->territories->{$lang} :
            Zend_Locale::getLocaleToTerritory($lang);
        return $territory;
    }
1290646
public function setLang($lang_code){
		$lang = $this->dom->metadata->children('dc', true)->language[0];
		$lang[0] = $this->h($lang_code);
		return $lang;
	}
692740
public function setLanguage($language)
    {
        if (Switcher::getRedirect() == 'route') {
            return redirect(Switcher::getRedirectRoute())->withCookie(Switcher::setLanguage($language));
        }
        if (Switcher::getRedirect() == 'locale') {
            return redirect(Switcher::getLocalBack($language))->withCookie(Switcher::setLanguage($language));
        }
        return back()->withCookie(Switcher::setLanguage($language));
    }
1138836
public function setLanguage($language)
    {
        if ($this->getStorageMethod() == 'cookie') {
            return cookie()->forever($this->getLanguageKey(), $language);
        }
        if ( interface_exists( \Illuminate\Contracts\Session\Session::class ) && method_exists(\Illuminate\Contracts\Session\Session::class, 'put') ) {
            Session::put($this->getLanguageKey(), $language);
        } else {
            Session::set($this->getLanguageKey(), $language);
        }
        $this->registerLanguage();
        return cookie('dummy-cookie', FALSE, 1); //just for cleaner code in the controller
    }