Set the language to use.

@param string $language The language to use (eg 'en')

@return self
177878
public function withLanguage(string $language): self
    {
        $provider = clone $this;

        $provider->language = $this->getLanguage($language);

        return $provider;
    }
856677
public function setCurrentLanguage($language)
    {
        if (empty(self::$supported_languages[$language])) {
            return false;
        }
        
        self::$current_language = $language;
        
        session()->vars()[self::$context . "_language"] = $language;
        
        setcookie(self::$context . "_language", $language, time() + 365 * 24 * 3600);
        
        return true;
    }
966512
public function setLanguage($lang): bool
    {
        if (Arr::in($lang, App::$Properties->get('languages'))) {
            $this->language = $lang;
            return true;
        }

        return false;
    }
226861
public function setLanguage($lang)
    {
        $this->clearCachedValueIf($this->lang != $lang);
        $this->lang = $lang;
    }
831373
public function setLanguage($language)
    {
        $language = $language ?: $this->language;
        if (!in_array($language, $this->getSupportedLanguages())) {
            throw new LanguageNotSupportedException(sprintf('Language [%s] is not supported', $language));
        }

        $this->language = $language;
        $this->changeBaseApi();
        return true;
    }
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;
    }
1179086
public function setCurrentLanguage($language)
    {
        if (!$this->isAvailable($language)) {
            return false;
        }

        $this->session->put('language', $language);

        $this->setLanguage($language);

        return true;
    }
839234
def set_language(self, language):
        
        if isinstance(language, str):
            language_obj = languages.getlang(language)
            if language_obj:
                self.language = language_obj.code
            else:
                raise TypeError("Language code {} not found".format(language))
        if isinstance(language, languages.Language):
            self.language = language.code
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
    }
150391
public function setTranslatableLang($lang)
    {
        if (is_string($lang)) {
            $lang = new Lang($lang);
        }

        $this->translatableLang = $lang;

        return $this;
    }
507488
public function setLanguage($language)
    {
        if (!array_key_exists($language, $this->allowedlanguages)) {
            throw new InvalidArgumentException("Invalid language ISO code");
        }
        $this->parameters['language'] = $language;
    }
1065226
public function setTargetLanguage(string $language): void
    {
        $this->xliff->setTargetLanguage($language);
        $this->markChanged();
    }
868700
public function setLanguage($value)
    {
        //$value = strtolower($value);
        if (!isset($this->owner->{$this->translationsAttribute}[$value])) {
            $this->owner->{$this->translationsAttribute}[$value] = $this->loadTranslation($value);
        }
        $this->_language = $value;
    }
1202064
public function removeLanguage($language)
    {
        $language = (string)$language;
        if (isset($this->entries[$language])) {
            unset($this->entries[$language]);
        }
        return $this;
    }
1127201
public function change(string $db): self
  {
    if ( $this->language->change($db) ){
      $this->current = $db;
    }
    return $this;
  }
280473
public function setLanguage(Language\Language $language)
    {
        $this->factory->setLanguage($language);
        $this->pushLanguage();
    }
28515
public function setLanguage($language)
    {
        if ($language == $this->currentLanguage) {
            return;
        }

        if (!$this->isLoaded($language)) {
            $this->loadLanguage($language);
        }

        switch ($language) {
            case 'fr':
                setlocale(LC_ALL, 'fr_FR.utf8', 'fr_FR.UTF-8', 'fr_FR@euro', 'fr_FR', 'french');
                break;
            case 'en':
                setlocale(LC_ALL, 'en_US.utf8', 'en_US.UTF-8', 'en_US');
                break;
            case 'de':
                setlocale(LC_ALL, 'de_DE.utf8', 'de_DE.UTF-8', 'de_DE@euro', 'de_DE', 'deutsch');
                break;
        }

        $this->currentLanguage = $language;
        $this->currentLanguageId = $this->languagesIso[$language]['id'];
    }