Change the learned language with
        ``https://www.duolingo.com/switch_language``.

        :param lang: Wanted language abbreviation (example: ``'fr'``)
        :type lang: str
351162
def _switch_language(self, lang):
        
        data = {"learning_language": lang}
        url = "https://www.duolingo.com/switch_language"
        request = self._make_req(url, data)

        try:
            parse = request.json()['tracking_properties']
            if parse['learning_language'] == lang:
                self.user_data = Struct(**self._get_data())
        except:
            raise Exception('Failed to switch language')
588603
def get_language(language_name):
    

    langs = list(pkg_resources.iter_entry_points(group=LANG_EP,
                                                 name=language_name))

    if not langs:
        raise TextXError('Language "{}" is not registered.'
                         .format(language_name))

    if len(langs) > 1:
        # Multiple languages defined with the same name
        raise TextXError('Language "{}" registered multiple times:\n{}'
                         .format(language_name,
                                 "\n".join([l.dist for l in langs])))

    return langs[0].load()()
126543
def say(self, txt, lang=None):
        '''
        
        '''
        lang = lang or self.classify(txt)
        self.get_engine_for_lang(lang).say(txt, language=lang)
905746
public static function setLang($lang)
    {
        phpCAS::_validateClientExists();

        try {
            self::$_PHPCAS_CLIENT->setLang($lang);
        } catch (Exception $e) {
            phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
        }
    }
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'];
    }
97564
def redirect_to_lang(*args, **kwargs):
    ''''''
    endpoint = request.endpoint.replace('_redirect', '')
    kwargs = multi_to_dict(request.args)
    kwargs.update(request.view_args)
    kwargs['lang_code'] = default_lang
    return redirect(url_for(endpoint, **kwargs))
590905
def load_lang_conf():
    
    if osp.isfile(LANG_FILE):
        with open(LANG_FILE, 'r') as f:
            lang = f.read()
    else:
        lang = get_interface_language()
        save_lang_conf(lang)

    # Save language again if it's been disabled
    if lang.strip('\n') in DISABLED_LANGUAGES:
        lang = DEFAULT_LANGUAGE
        save_lang_conf(lang)

    return lang
627443
def update(self, other: 'Language') -> 'Language':
        
        return Language.make(
            language=other.language or self.language,
            extlangs=other.extlangs or self.extlangs,
            script=other.script or self.script,
            region=other.region or self.region,
            variants=other.variants or self.variants,
            extensions=other.extensions or self.extensions,
            private=other.private or self.private
        )
1366118
def set(self, lang, instance):
        
        if self._cache_is_too_big():
            self.cache = {}
        instance_key = TransCache._create_key(lang, instance)
        instance._translations_are_cached = True
        instance.load_translations(lang=lang)
        self.cache[instance_key] = instance
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
966512
public function setLanguage($lang): bool
    {
        if (Arr::in($lang, App::$Properties->get('languages'))) {
            $this->language = $lang;
            return true;
        }

        return false;
    }
671288
public function setLanguage($lang)
	{
		$this->lang     = $lang;
		$this->metadata = $this->getMetadata($this->lang);

		return $this;
	}
53205
public function setLang( $lang ) {
		if ( !IntuitionUtil::nonEmptyStr( $lang ) ) {
			return false;
		}
		$this->currentLanguage = $this->normalizeLang( $lang );
		return true;
	}
1000847
def set_language(language)
      edit_plist(path.global_preferences_plist) do |plist|
        key = 'AppleLanguages'
        plist[key] = [] unless plist.key?(key)
        plist[key].unshift(language).uniq!
      end
    end
888341
def language_to_locale(language):
    
    tokens = language.split('-')
    if len(tokens) == 1:
        return tokens[0]
    return "%s_%s" % (tokens[0], tokens[1].upper())
1315968
def get_language(self):
        
        locale = self.get_locale()
        language = locale
        if '_' in locale:
            language = locale[0:locale.index('_')]
        return language
623709
def activate(lang=None):
    
    if lang is None:
        lang = locale.getlocale()[0]
    tr = gettext.translation("argparse", os.path.join(locpath, "locale"),
                             [lang], fallback=True)
    argparse._ = tr.gettext
    argparse.ngettext = tr.ngettext