Sets the ISO language code.

@param string|null $langid ISO language code (e.g. de or de_DE)
@throws MShop_Exception If the language ID is invalid
198268
public function setLanguageId( $langid )
	{
		if ( $langid == $this->getLanguageId() ) { return; }

		$this->_checkLanguageId( $langid );
		$this->_values['langid'] = $langid;
		$this->setModified();
	}
1204186
public function setCode( $key )
	{
		if ( $key == $this->getCode() ) { return; }

		if ( strlen($key) != 3 || ctype_alpha( $key ) === false ) {
			throw new MShop_Locale_Exception( sprintf( 'Invalid characters in ISO currency code "%1$s"', $key ) );
		}

		$this->_values['code'] = strtoupper( $key );
		$this->_modified = true;
	}
851553
@Override
  public final void setItsId(final IdI18nSpecificInList pItsId) {
    this.itsId = pItsId;
    if (this.itsId == null) {
      this.lang = null;
      this.itemId = null;
      this.itsType = null;
    } else {
      this.lang = this.itsId.getLang();
      this.itemId = this.itsId.getItemId();
      this.itsType = this.itsId.getItsType();
    }
  }
1106761
public function setCode( $key )
	{
		if ( $key == $this->getCode() ) { return; }

		$len = strlen( $key );
		if ( $len < 2 || $len > 5 || preg_match( '/^[a-z]{2,3}((-|_)[a-zA-Z]{2})?$/', $key ) !== 1 ) {
			throw new MShop_Locale_Exception(sprintf( 'Invalid characters in ISO language code "%1$s"', $key ) );
		}

		$this->_values['code'] = (string) $key;
		$this->_modified = true;
	}
10141
public function setLang(\Core\Entity\Language $lang = null)
    {
        $this->lang = $lang;

        return $this;
    }
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;
        }
    }
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);
    }
1126347
@Override
  public final void setItsId(final IdI18nSpecificsOfItemGroup pItsId) {
    this.itsId = pItsId;
    if (this.itsId == null) {
      this.lang = null;
      this.hasName = null;
    } else {
      this.lang = this.itsId.getLang();
      this.hasName = this.itsId.getHasName();
    }
  }
1334099
public function setLanguageId($iLanguageId)
    {
        $iOldLang = $this->_iLanguageId;
        $this->_iLanguageId = $iLanguageId;

        // #0003777: reload content on language change
        if ($iOldLang !== null && $iOldLang != $iLanguageId) {
            try {
                $this->_setArticle($this->getProductId());
            } catch (\OxidEsales\Eshop\Core\Exception\NoArticleException $oEx) {
                \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($oEx);
            } catch (\OxidEsales\Eshop\Core\Exception\ArticleInputException $oEx) {
                \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($oEx);
            }
        }
    }
869256
public static function setLanguage($lang)
    {
        Application::$instance->i18n->setLanguage($lang);
        \Config::set('i18n.language', $lang);
    }
718308
@Override
  public final void setLang(final Languages pLang) {
    this.lang = pLang;
    if (this.itsId == null) {
      this.itsId = new IdI18nSpecificsOfItemGroup();
    }
    this.itsId.setLang(this.lang);
  }
759488
protected function _getShop($langId = null, $shopId = null)
    {
        if ($langId === null && $shopId === null) {
            if (isset($this->_oShop)) {
                return $this->_oShop;
            } else {
                return $this->_oShop = Registry::getConfig()->getActiveShop();
            }
        }

        $myConfig = Registry::getConfig();

        $shop = oxNew(\OxidEsales\Eshop\Application\Model\Shop::class);
        if ($shopId !== null) {
            $shop->setShopId($shopId);
        }
        if ($langId !== null) {
            $shop->setLanguage($langId);
        }
        $shop->load($myConfig->getShopId());

        return $shop;
    }
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();
	}
408313
@Override
  public final void setLang(final Languages pLang) {
    this.lang = pLang;
    if (this.itsId == null) {
      this.itsId = new IdI18nUnitOfMeasure();
    }
    this.itsId.setLang(this.lang);
  }
544132
public function setLang($lang) 
    {
        switch ($lang) {
        case 'en':
            self::$_encode = ' etaoins';
            break;
        case 'fr':
            self::$_encode = ' enasriu';
            break;
        case 'gr':
            self::$_encode = ' enristu';
            break;
        case 'it':
            self::$_encode = ' eiaorln';
            break;
        case 'sp':
            self::$_encode = ' eaosrin';
            break;
        default:
            self::$_encode = iconv('utf-8', 'cp1256', ' الميوتة');
        }

        self::$_binary = '0000|0001|0010|0011|0100|0101|0110|0111|';
        
        return $this;
    }
888125
public function lookupLocaleForLanguageId($languageId)
    {
        /** @var Model $languageModel */
        $languageModel = static::$cmsLanguageModel;

        $language = $languageModel::where('id', $languageId)
            ->remember((config('pxlcms.cache.languages', 15)))
            ->first();

        if (empty($language)) return null;

        return $this->normalizeToLocale($language->code);
    }
781552
public function setLanguage($language = \Genesis\API\Constants\i18n::EN)
    {
        // Strip the input down to two letters
        $language = substr(strtolower($language), 0, 2);

        if (!\Genesis\API\Constants\i18n::isValidLanguageCode($language)) {
            throw new \Genesis\Exceptions\InvalidArgument(
                'The provided argument is not a valid ISO-639-1 language code!'
            );
        }

        $this->setApiConfig(
            'url',
            $this->buildRequestURL(
                'wpf',
                sprintf('%s/wpf', $language),
                false
            )
        );

        return $this;
    }