Update the preferred language in Customizr
@param {string} accessToken - Access token to use to call Customizr
@param {string} languageCode - ISO-639 language code (eg. bul, en, eng, de)
@return {Promise<void>}
962142
async function setPreferredMcpLanguage(accessToken, languageCode) {
    let language = getValidLanguageOrThrow(languageCode);

    let currentLanguages = await getPreferredMcpLanguages(accessToken);

    return mcpCustomizr.putSettings(accessToken, {
        language: updatePreferredLanguage(language, currentLanguages),
    });
}
1048564
public function editLanguage($code = null)
    {
        $this->setLanguage($code);
        $this->setTitleEditLanguage();
        $this->setBreadcrumbEditLanguage();

        $this->setData('edit', isset($code));
        $this->setData('language', $this->data_language);
        $this->setData('can_delete', $this->canDeleteLanguage());
        $this->setData('default_language', $this->language->getDefault());

        $this->submitEditLanguage();
        $this->outputEditLanguage();
    }
645714
@com.fasterxml.jackson.annotation.JsonProperty("SourceLanguageCode")
    public void setSourceLanguageCode(String sourceLanguageCode) {
        this.sourceLanguageCode = sourceLanguageCode;
    }
507966
public static ProductCreateResult productUpdate(String accessToken, ProductUpdate productUpdate) {
        return productUpdate(accessToken, JsonUtil.toJSONString(productUpdate));
    }
999616
function language(opt) {

  var options = opt || Object.create(null);
  var include = __dirname + '/min/lib/dictionary.js';
  var lang = options.dictionary || require(include).LANG;
  var my = {
    cookie: String(options.cookie || 'lang'),
    domain: String(options.domain || ''),
    path: String(options.path || '/'),
    maxAge: Number(options.maxAge) || 1000 * 3600 * 24 * 365,
    httpOnly: Boolean(options.httpOnly),
    secure: Boolean(options.secure),
    signed: Boolean(options.signed)
  };

  if (lang._default === undefined) {
    lang = require(include).LANG;
  } else if (!all[lang._default]) {
    console.error('language misconfigured');
    lang = require(include).LANG;
  }
  /**
   * @global
   */
  process.env.lang = lang._default;
  // return
  var cookie = 'cookies';
  if (my.signed) {
    cookie = 'signedCookies';
  }

  if (typeof options.encryptionSecret === 'string') {
    var vault = require('cookie-encryption');
    var encryptionOptions = opt.encryptionOptions || Object.create(null);
    vault = vault(options.encryptionSecret, {
      cookie: my.cookie,
      cipher: encryptionOptions.cipher,
      encoding: encryptionOptions.encoding,
      extra: encryptionOptions.extra,
      domain: encryptionOptions.domain || my.domain,
      path: encryptionOptions.path || my.path,
      maxAge: encryptionOptions.maxAge || my.maxAge,
      httpOnly: encryptionOptions.httpOnly || my.httpOnly,
      secure: encryptionOptions.secure || my.secure,
      signed: encryptionOptions.signed || my.signed
    });

    /**
     * detect language and (if accepted) build it. Store information on cookie
     * 
     * @function browser
     * @param {Object} req - client request
     * @param {Object} res - response to client
     * @param {next} next - continue routes
     */
    return function browser(req, res, next) {

      var biscotto;
      try {
        biscotto = vault.read(req);
      } catch (e) { // fails to decrpy
        biscotto = undefined;
      }
      if (biscotto && lang[biscotto]) { // lookup
        req[cookie][my.cookie] = biscotto;
        return next();
      }

      var ll = detect(lang._default, req.headers['accept-language'], lang);
      req[cookie][my.cookie] = vault.write(req, ll); // populate req[cookie] by module

      return next();
    };
  }

  /**
   * detect language and (if accepted) build it. Store information on cookie
   * 
   * @function browser
   * @param {Object} req - client request
   * @param {Object} res - response to client
   * @param {next} next - continue routes
   */
  return function browser(req, res, next) {

    var biscotto = req[cookie];
    if (biscotto === undefined) {
      biscotto = Object.create(null);
    } else if (lang[biscotto[my.cookie]]) { // lookup
      return next();
    }

    var ll = detect(lang._default, req.headers['accept-language'], lang);
    biscotto[my.cookie] = set(my, res, ll);

    return next();
  };
}
86021
public static ModifyDomainResult modify_domain(String access_token,ModifyDomain modifyDomain){
		String json = JsonUtil.toJSONString(modifyDomain);
		HttpUriRequest httpUriRequest = RequestBuilder.post()
				.setHeader(jsonHeader)
				.setUri(BASE_URI + "/wxa/modify_domain")
				.addParameter(PARAM_ACCESS_TOKEN, API.accessToken(access_token))
				.setEntity(new StringEntity(json,Charset.forName("utf-8")))
				.build();
		return LocalHttpClient.executeJsonResult(httpUriRequest,ModifyDomainResult.class);
	}
187250
public static BaseResult codeUpdate(String accessToken, CodeUpdate codeUpdate) {
		return codeUpdate(accessToken, JsonUtil.toJSONString(codeUpdate));
	}
998434
def add_language_to_project(self, project_id, language_code):
        
        self._run(
            url_path="languages/add",
            id=project_id,
            language=language_code
        )
        return True
121927
public static QueryrecoresultfortextResult queryrecoresultfortext(String accessToken, String voiceId, String lang) {
        HttpUriRequest httpUriRequest = RequestBuilder.post()
                .setUri(BASE_URI + "/cgi-bin/media/voice/queryrecoresultfortext")
                .addParameter(PARAM_ACCESS_TOKEN, API.accessToken(accessToken))
                .addParameter("voice_id", voiceId)
                .addParameter("lang", lang == null || lang.isEmpty() ? "zh_CN" : lang)
                .build();

        return LocalHttpClient.executeJsonResult(httpUriRequest,
                QueryrecoresultfortextResult.class);
    }
85870
function setLanguage(language) {
  window[App.pkg.settings.storage_engine || 'localStorage'][App.pkg._id + '-language'] = language;

  var xhr = null;
  var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"];
  if(window.ActiveXObject) {
    for(var i = 0; i < activexmodes.length; i++) {
      try {
        xhr = new ActiveXObject(activexmodes[i]);
      } catch(e) {}
    }
  } else {
    xhr = new XMLHttpRequest();
  }
  xhr.open('GET', 'languages/' + language + '.json', false);
  xhr.send(null);

  if(xhr.status == 200 || xhr.status == 201) {
    var response = JSON.parse(xhr.responseText);
    Globalize.culture(language);
    Globalize.addCultureInfo(language, {
      messages: response,
    });
  }
}
1290646
public function setLang($lang_code){
		$lang = $this->dom->metadata->children('dc', true)->language[0];
		$lang[0] = $this->h($lang_code);
		return $lang;
	}
1191650
function (opts, callback) {
        var locale_promise, theme_promise,
            that = this;

        opts = opts || {};

        this.initUtils();

        // Set up the settings datastore
        _kiwi.global.settings = _kiwi.model.DataStore.instance('kiwi.settings');
        _kiwi.global.settings.load();

        // Set the window title
        window.document.title = opts.server_settings.client.window_title || 'Kiwi IRC';

        locale_promise = new Promise(function (resolve) {
            // In order, find a locale from the users saved settings, the URL, default settings on the server, or auto detect
            var locale = _kiwi.global.settings.get('locale') || opts.locale || opts.server_settings.client.settings.locale || 'magic';
            $.getJSON(opts.base_path + '/assets/locales/' + locale + '.json', function (locale) {
                if (locale) {
                    that.i18n = new Jed(locale);
                } else {
                    that.i18n = new Jed();
                }
                resolve();
            });
        });

        theme_promise = new Promise(function (resolve) {
            var text_theme = opts.server_settings.client.settings.text_theme || 'default';
            $.getJSON(opts.base_path + '/assets/text_themes/' + text_theme + '.json', function(text_theme) {
                opts.text_theme = text_theme;
                resolve();
            });
        });


        Promise.all([locale_promise, theme_promise]).then(function () {
            _kiwi.app = new _kiwi.model.Application(opts);

            // Start the client up
            _kiwi.app.initializeInterfaces();

            // Event emitter to let plugins interface with parts of kiwi
            _kiwi.global.events  = new PluginInterface();

            // Now everything has started up, load the plugin manager for third party plugins
            _kiwi.global.plugins = new _kiwi.model.PluginManager();

            callback();

        }).then(null, function(err) {
            console.error(err.stack);
        });
    }
144956
public function setDefaultAccessToken($accessToken)
    {
        if (is_string($accessToken)) {
            $this->defaultAccessToken = new AccessToken($accessToken);
        }
        if ($accessToken instanceof AccessToken) {
            $this->defaultAccessToken = $accessToken;
        }

       // throw new \InvalidArgumentException('Токен ключ по умолчанию должен быть типа string или \Steein\SDK\Authentication\AccessToken');
    }
725699
public function withAccessToken (AccessToken $token)
    {
        $config = $this->getConfig();
        $this->configureHandlers($config['handler']);
        
        $config['wechat.accessToken'] = $token;
        $config['wechat.developerMode'] = $this->developerMode;
        
        return new static($config);
    }
644954
protected function setTranslationFromEditor($access, LocaleEntity $locale, TranslatableEntity $translatable, UserEntity $user, PackageVersionEntity $packageVersion = null)
    {
        $translation = null;
        $strings = $this->post('translated');
        $numStrings = ($translatable->getPlural() === '') ? 1 : $locale->getPluralCount();
        if (is_array($strings)) {
            $strings = array_values($strings);
            if (count($strings) === $numStrings) {
                foreach ($strings as $index => $string) {
                    if (is_string($string)) {
                        $string = str_replace("\r", "\n", str_replace("\r\n", "\n", $string));
                    } else {
                        $string = '';
                    }
                    if (trim($string) === '') {
                        $translation = null;
                        break;
                    }
                    if ($index === 0) {
                        $translation = TranslationEntity::create($locale, $translatable, $strings[0]);
                    } else {
                        $translation->{"setText$index"}($string);
                    }
                }
            }
        }
        if ($translation === null) {
            throw new UserMessageException(t('Please specify the translations'));
        }
        if ($access >= Access::ADMIN) {
            if ($this->post('approved') === '1') {
                $approved = true;
            } elseif ($this->post('approved') === '0') {
                $approved = false;
            } else {
                throw new UserMessageException(t('Missing parameter: %s', 'approved'));
            }
        } else {
            $approved = false;
        }

        $translations = $this->convertTranslationToGettext($translation, !$approved);
        $importer = $this->app->make(Importer::class);
        $imported = $importer->import($translations, $locale, $user, ($access >= Access::ADMIN) ? ImportOptions::forAdministrators() : ImportOptions::forTranslators());
        $this->getEntityManager()->clear();
        $translatable = $this->app->make(TranslatableRepository::class)->find($translatable->getID());
        $locale = $this->app->make(LocaleRepository::class)->find($locale->getID());
        if ($imported->newApprovalNeeded > 0) {
            $this->app->make(NotificationRepository::class)->translationsNeedApproval(
                $locale,
                $imported->newApprovalNeeded,
                $user->getUserID(),
                ($packageVersion === null) ? null : $packageVersion->getID()
            );
        }

        $result = $this->app->make(Editor::class)->getTranslations($locale, $translatable);
        if ($imported->newApprovalNeeded && !$imported->addedAsCurrent) {
            $result['message'] = t('Since the current translation is approved, you have to wait that this new translation will be approved');
        }

        return $this->app->make(ResponseFactoryInterface::class)->json($result);
    }
652991
function _updateLanguageInfo(editor) {
        var doc = editor.document,
            lang = doc.getLanguage();

        // Show the current language as button title
        languageSelect.$button.text(lang.getName());
    }
602168
public static UpdateResult update(String accessToken, UpdateGift updateGift) {
		return update(accessToken, JsonUtil.toJSONString(updateGift));
	}