Sets the default language
@param string $lang The language
@throws \InvalidArgumentException If the langauge is invalid
777649
public function setLanguage(string $lang): void
    {
        if (!is_string($lang) || empty($lang)) {
            throw new \InvalidArgumentException("Invalid language $lang");
        }
        
        $this->lang = $lang;
    }
1193885
public function setLocale(string $locale): self
	{
		if ($locale === '') {
			$this->locale = $locale;
		} else {
			if (!\Locale::parseLocale($locale)) {
				throw new \InvalidArgumentException(sprintf('Invalid locale "%s"', $locale));
			}
			$this->locale = \Locale::canonicalize($locale);
		}

		$this->setOptions['locale'] = null;

		return $this;
	}
110569
protected function setActiveLanguage($language)
    {
        $languages = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageIds();
        $languageId = array_search($language, $languages);
        if ($languageId === false) {
            throw new Exception("Language $language was not found or is not active in shop");
        }
        \OxidEsales\Eshop\Core\Registry::getLang()->setBaseLanguage($languageId);
    }
1153287
public static function set($lang)
    {
        exception_if(!in_array($lang, self::$supported), LanguageNotSupportedException::class, $lang);

        Cookie::create(self::$cookieName, $lang, config('lang.lifetime'));
        Session::put(self::$sessionName, $lang);

        self::change($lang);

        return true;
    }
149232
protected function initDefaultLanguage( array $config )
    {
        $language = 'en_US';

        if ( isset( $config[ 'default_language' ] ) )
        {
            $language = $config[ 'default_language' ];
        }

        $this->defaultLanguage = $language;
    }
376406
public function setLanguage($lang)
    {
        if (!Icepay_Parameter_Validation::language($lang))
            throw new Exception('Language not valid');
        $this->data->ic_language = $lang;
        return $this;
    }
285930
public function setLang(Lang $language = null)
    {
        $this->language = $language;

        if ($this->originalOrderAndAliases === null) {
            $this->originalOrderAndAliases = $this->orderAndAliases;
        }

        if ($this->language !== null && $this->orderAndAliases !== null) {
            $previousLocale = Translator::getInstance()->getLocale();

            Translator::getInstance()->setLocale($this->language->getLocale());
            foreach ($this->orderAndAliases as &$alias) {
                $alias = Translator::getInstance()->trans($alias);
            }

            Translator::getInstance()->setLocale($previousLocale);
        }

        return $this;
    }
769714
public function setLanguage($language = 'ro')
    {
        $language = trim(strtolower($language));
        switch ($language) {
            case 'ro':
                $this->language = 'ro';
                break;
            case 'en':
            default:
                $this->language = 'en';
        }

        return true;
    }
144882
public function set_diacritic_language( $lang = 'en-US' ) {
		if ( isset( $this->data['diacriticLanguage'] ) && $this->data['diacriticLanguage'] === $lang ) {
			return;
		}

		$this->data['diacriticLanguage'] = $lang;
		$language_file_name              = \dirname( __FILE__ ) . '/diacritics/' . $lang . '.json';

		if ( \file_exists( $language_file_name ) ) {
			$diacritics_file              = \json_decode( \file_get_contents( $language_file_name ), true );
			$this->data['diacriticWords'] = $diacritics_file['diacritic_words'];
		} else {
			unset( $this->data['diacriticWords'] );
		}

		$this->update_diacritics_replacement_arrays();
	}
1133299
public function setLanguage($language) {
        if (!session_id()) {
            if ($this->sessionManager) {
                $this->sessionManager->start();
            }
        }
		$_SESSION['_fine_I18n_language'] = $language;
	}
1107339
public function setLanguage($language = null)
    {
        if (is_null($language)) {
            if (($language = Yii::$app->request->getQueryParam('_lang')) !== null) {
                $this->language = $language;
                Yii::$app->response->cookies->add(new Cookie(['name' => '_lang', 'value' => $language]));
            } else if (($cookie = Yii::$app->request->cookies->get('_lang')) !== null) {
                $this->language = $cookie->value;
            } else if (($language = Yii::$app->request->getPreferredLanguage()) !== null) {
                $this->language = $language;
            }
        } else {
            $this->language = $language;
        }
    }
1065226
public function setTargetLanguage(string $language): void
    {
        $this->xliff->setTargetLanguage($language);
        $this->markChanged();
    }
319292
public function setLanguage($language)
    {
        if (!is_string($language) || strlen($language) !== 2) {
            throw new MonetivoException('Language format is invalid');
        }
        $language = strtolower($language);

        $this->language = in_array($language, self::$supported_langs) ? $language : 'en';
    }
1130804
public static function setLanguage($language)
    {
        // regex source: http://www.w3.org/TR/xmlschema11-2/#language
        if (preg_match('/[a-z]{1,8}(-[a-z0-9]{1,8})*/i', $language) === 1) {
            self::$language = $language;
        } else {
            trigger_error('Invalid language tag: ' . $language, E_USER_WARNING);
        }
    }
919751
public static function setLanguage($language)
    {
        if (! ($language instanceof Language)) {
            $language = Language::findByCode($language);
        }

        if (! $language) {
            return false;
        }

        App::setLocale($language->code);
        request()->setDefaultLocale($language->code);
        self::$language = $language;

        return $language;
    }
1260106
public function setLanguage($lang)
    {
      if (isset($this->commonUploadErrors[$lang])) {
        $this->language = $lang;
      } else {
        $this->error = $this->commonUploadErrors[$this->language]['ERROR_09'];
      }

      return $this;
    }
654648
public function setLanguage($language)
    {
        if (!is_string($language)) {
            throw new \InvalidArgumentException('The attribute language on the class Project has to be string (' . gettype($language) . ('object' === gettype($language) ? ' ' . get_class($language) : '') . ' given).');
        }

        $this->language = $language;

        return $this;
    }