Sets the current language code.

@method setCode
@param {String} newCode Current language code.
512694
function (newCode) {
        if (newCode) {
          code = newCode;
          this.rtl = this.data[newCode] ? this.data[newCode]._dir === 'rtl' : false;
        }
      }
326403
public function setReceptionCode($newCode, $userId)
    {
        $oldCode = $this->respondentTrack->getReceptionCode();
        
        if (! $newCode instanceof \Gems_Util_ReceptionCode) {
            $newCode = $this->util->getReceptionCode($newCode);
        }

        // Use the repesondent track function as that cascades the consent code
        $changed = $this->respondentTrack->setReceptionCode($newCode, $this->formData['gr2t_comment'], $userId);

        if ($this->unDelete) {
            $this->addMessage($this->_('Track restored.'));

            if (isset($this->formData['restore_tokens']) && $this->formData['restore_tokens']) {                
                $count = $this->respondentTrack->restoreTokens($oldCode, $newCode);
                
                $this->addMessage(sprintf($this->plural(
                        '%d token reception codes restored.',
                        '%d tokens reception codes restored.',
                        $count
                        ), $count));
            }
        } else {
            if ($newCode->isStopCode()) {
                $this->addMessage($this->_('Track stopped.'));
            } else {
                $this->addMessage($this->_('Track deleted.'));
            }
        }

        return $changed;
    }
134210
public void setString(String[] newValue) {
        if ( newValue != null ) {
            this.string.setValue(newValue.length, newValue);
        }
    }
712518
private function setLanguageFromBrowser(): void
    {
        $userLang = App::$Properties->get('singleLanguage');
        $browserAccept = $this->getLanguages();
        if (Any::isArray($browserAccept) && count($browserAccept) > 0) {
            foreach ($browserAccept as $bLang) {
                if (Arr::in($bLang, App::$Properties->get('languages'))) {
                    $userLang = $bLang;
                    break; // stop calculating, language is founded in priority
                }
            }
        }

        // parse query string
        $queryString = null;
        if (count($this->query->all()) > 0) {
            $queryString = '?' . http_build_query($this->query->all());
        }

        // build response with redirect to language-based path
        $redirectUrl = $this->getSchemeAndHttpHost() . $this->basePath . '/' . $userLang . $this->getPathInfo() . $queryString;
        $response = new RedirectResponse($redirectUrl);
        $response->send();
        exit();
    }
585247
def set_code(self, key, code):
        """"""

        old_code = self.grid.code_array(key)

        try:
            old_code = unicode(old_code, encoding="utf-8")

        except TypeError:
            pass

        if code == old_code:
            return

        if not (old_code is None and not code) and code != old_code:
            # Mark content as changed
            post_command_event(self.main_window, self.ContentChangedMsg)

        # Set cell code
        self.grid.code_array.__setitem__(key, code)
645714
@com.fasterxml.jackson.annotation.JsonProperty("SourceLanguageCode")
    public void setSourceLanguageCode(String sourceLanguageCode) {
        this.sourceLanguageCode = sourceLanguageCode;
    }
1113108
public function setCountryCodeAttribute($code)
    {
        if (!$country = Country::whereCode($code)->first()) {
            return;
        }

        $this->model->country = $country;
    }
788053
def set_lang(lang_code=None):
    """"""
    # Check if language is available.
    lang_code = lang_code or request.values.get('lang_code')
    languages = dict(current_app.extensions['invenio-i18n'].get_languages())
    if lang_code is None or lang_code not in languages:
        abort(404 if request.method == 'GET' else 400)

    # Set language in session.
    session[current_app.config['I18N_SESSION_KEY']] = lang_code.lower()

    # Redirect user back.
    target = get_redirect_target()
    if not target:
        endpoint = current_app.config['I18N_DEFAULT_REDIRECT_ENDPOINT']
        target = url_for(endpoint) if endpoint else '/'

    return redirect(target)
327868
public void setLanguage(String strLanguage)
    {
        Record recUserInfo = (Record)this.getUserInfo();
        if (recUserInfo != null)
        {
        	boolean flag = recUserInfo.getField(UserInfoModel.PROPERTIES).isModified();
        	boolean[] brgEnabled = recUserInfo.getField(UserInfoModel.PROPERTIES).setEnableListeners(false);
            ((PropertiesField)recUserInfo.getField(UserInfoModel.PROPERTIES)).setProperty(DBParams.LANGUAGE, strLanguage);
            recUserInfo.getField(UserInfoModel.PROPERTIES).setModified(flag);
            recUserInfo.getField(UserInfoModel.PROPERTIES).setEnableListeners(brgEnabled);
        }
        super.setLanguage(strLanguage);
    }
714502
public void setCodes(Set<Code> codes) {
        Exceptions.nullArgument("codes", codes);

        this.codes.clear();
        this.codes.addAll(codes);
    }
951053
function initPHP( $charset = false )
    {
        if ( $charset === false )
            $charset = $this->Language->code();
        setlocale( LC_ALL, $charset );
    }
634155
public void setCode(ExprCode code) {
        mCode = code;

        mStartPos = mCode.mStartPos;
        mCurIndex = mStartPos;
    }
424329
public function reset(string $code, string $new_password): bool
    {
        return $this->auth_repository->reset($code, $new_password);
    }
479006
@Override
  public final void setLang(final Languages pLang) {
    this.lang = pLang;
    if (this.itsId == null) {
      this.itsId = new IdI18nInvItem();
    }
    this.itsId.setLang(this.lang);
  }
193926
public function setCode(int $code)
    {
        $allowed_codes = [
            0,
            1,
            2
        ];

        if (!in_array($code, $allowed_codes)) {
            $code = 1;
        }

        $this->code = $code;
    }
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
1272965
function setLanguage () {
		if (!defined('LANGUAGES')){
			define('LANGUAGES', 'en');
		}	
		$this->i18nURL();
		if (!defined('LANG')){
			if (!$this->lang){
				$this->lang = 'en';
			}
			define('LANG', $this->lang);
		}
	}