Assign the language for the retrieved object.
6644
def get_object(self, queryset=None):
        
        object = super(LanguageChoiceMixin, self).get_object(queryset)
        if isinstance(object, TranslatableModelMixin):
            object.set_current_language(self.get_language(), initialize=True)
        return object
608307
public void set(Language language) {
        this.language = language;

        Cookie cookie = new Cookie(COOKIE_NAME, language.name());
        cookie.setPath("/");
        cookie.setMaxAge(Integer.MAX_VALUE);
        VaadinService.getCurrentResponse().addCookie(cookie);
    }
217931
def _create_key(lang, instance):
        """"""
        model_name = instance.__class__.__name__
        return "{0}__{1}_{2}".format(lang,model_name,instance.id)
4129
def get_form_language(self, request, obj=None):
        
        if self._has_translatable_parent_model():
            return super(TranslatableInlineModelAdmin, self).get_form_language(request, obj=obj)
        else:
            # Follow the ?language parameter
            return self._language(request)
1298662
def setLanguage(self, language):
        
        cls = XCodeHighlighter.byName(language)
        if cls:
            self._highlighter = cls(self.document())
3358
def selectlanguage(self, event):
        """"""

        self.log('Language selection event:', event.client, pretty=True)

        if event.data not in all_languages():
            self.log('Unavailable language selected:', event.data, lvl=warn)
            language = None
        else:
            language = event.data

        if language is None:
            language = 'en'

        event.client.language = language

        if event.client.config is not None:
            event.client.config.language = language
            event.client.config.save()
124465
def language(self, language_code=None):
        
        if language_code is None:
            language_code = appsettings.PARLER_LANGUAGES.get_default_language()

        self._language = language_code
        return self
421569
def assign(self, key, value):
        """"""
        key_split = key.split('.')
        cur_dict = self
        for k in key_split[:-1]:
            try:
                cur_dict = cur_dict[k]
            except KeyError:
                cur_dict[k] = self.__class__()  # so that derived classes
                                                # remain true to type
                cur_dict = cur_dict[k]
        cur_dict[key_split[-1]] = value
344255
def set_alchemy_language(lang = nil)
      if lang
        @language = lang.is_a?(Language) ? lang : load_alchemy_language_from_id_or_code(lang)
      else
        # find the best language and remember it for later
        @language = load_alchemy_language_from_params ||
                    load_alchemy_language_from_session ||
                    Language.default
      end
      store_current_alchemy_language(@language)
    end
1082106
public void populateLanguages() {
    dataService.add(
        LANGUAGE,
        languageFactory.create(
            LanguageService.DEFAULT_LANGUAGE_CODE, LanguageService.DEFAULT_LANGUAGE_NAME, true));
    dataService.add(
        LANGUAGE,
        languageFactory.create("nl", new Locale("nl").getDisplayName(new Locale("nl")), false));
    dataService.add(
        LANGUAGE,
        languageFactory.create("pt", new Locale("pt").getDisplayName(new Locale("pt")), false));
    dataService.add(
        LANGUAGE,
        languageFactory.create("es", new Locale("es").getDisplayName(new Locale("es")), false));
    dataService.add(
        LANGUAGE,
        languageFactory.create("de", new Locale("de").getDisplayName(new Locale("de")), false));
    dataService.add(
        LANGUAGE,
        languageFactory.create("it", new Locale("it").getDisplayName(new Locale("it")), false));
    dataService.add(
        LANGUAGE,
        languageFactory.create("fr", new Locale("fr").getDisplayName(new Locale("fr")), false));
    dataService.add(LANGUAGE, languageFactory.create("xx", "My language", false));
  }
214248
def get_available_languages(self, obj):
        
        return obj.available_languages if obj is not None else self.model.objects.none()
1082032
def set_language(self, editor, language):
        

        LOGGER.debug("> Setting '{0}' language to '{1}' editor.".format(language.name, editor))

        return editor.set_language(language)
936655
function resolveLanguage ( value ) {
	if ( typeof value === 'string' ) {
		const lang = _.find(langs, ( o ) => { return o.locale.indexOf(value) !== -1; });
		if ( typeof lang !== 'undefined' ) {
			return lang.id;
		}
	}
	return value;
}
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
        )
1300956
def to_native(key):
    
    item = find(whatever=key)
    if not item:
        raise NonExistentLanguageError('Language does not exist.')
    return item[u'native']
322958
def get_translations(self, obj, language=None):
        
        lookup = {"identifier": obj.linguist_identifier, "object_id": obj.pk}

        if language is not None:
            lookup["language"] = language

        return self.get_queryset().filter(**lookup)
357782
def get_language_from_request(request):
    """"""
    language = request.GET.get('language', None)
    if language:
        return language

    if hasattr(request, 'LANGUAGE_CODE'):
        lang = settings.PAGE_LANGUAGE_MAPPING(str(request.LANGUAGE_CODE))
        if lang not in LANGUAGE_KEYS:
            return settings.PAGE_DEFAULT_LANGUAGE
        else:
            return lang
    else:
        return settings.PAGE_DEFAULT_LANGUAGE