Make sure the object is fetched in the correct language.
979667
def get_object(self, request, object_id, *args, **kwargs):
        
        obj = super(TranslatableAdmin, self).get_object(request, object_id, *args, **kwargs)

        if obj is not None and self._has_translatable_model():  # Allow fallback to regular models.
            obj.set_current_language(self._language(request, obj), initialize=True)

        return obj
332286
def translation_exists(self, slug, lang):
        """"""

        try:
            return translations.Translation.get(
                project_slug=self.get_project_slug(lang),
                slug=slug,
                lang=lang,
            )

        except (NotFoundError, RemoteServerError):
            pass

        return False
47095
def localeselector():
    """"""
    # if a user is logged in, use the locale from the user settings
    user = getattr(g, "user", None)
    if user is not None:
        locale = getattr(user, "locale", None)
        if locale:
            return locale

    # Otherwise, try to guess the language from the user accept header the browser
    # transmits.  By default we support en/fr. The best match wins.
    return request.accept_languages.best_match(
        current_app.config["BABEL_ACCEPT_LANGUAGES"]
    )
33433
function translateObject(language, key, destObj, keysArray, valuesArray) {
	return new Promise(function (resolve, reject) {
		var valuesStr = valuesArray.join(hashSimple);

		translateService.translate(valuesStr, {to: language}, function (err, res) {
			if (err || res.code !== 200) {
				reject(err || res);
			} else {
        // yandex return an array string and so we need split back to the normal vlues
				var result = res.text[0].split(hashSimple);
				for (var i = 0; i < keysArray.length; i++) {
					destObj[key][keysArray[i]] = result[i];
				}

				resolve(destObj);
			}
		});
	});
}
1117327
static function fetch( $id )
    {
        $languages = eZContentLanguage::fetchList();

        return isset( $languages[$id] )? $languages[$id]: false;
    }
1050437
def _get_object(data, position, obj_end, opts, dummy):
    """"""
    obj_size = _UNPACK_INT(data[position:position + 4])[0]
    end = position + obj_size - 1
    if data[end:position + obj_size] != b"\x00":
        raise InvalidBSON("bad eoo")
    if end >= obj_end:
        raise InvalidBSON("invalid object length")
    if _raw_document_class(opts.document_class):
        return (opts.document_class(data[position:end + 1], opts),
                position + obj_size)

    obj = _elements_to_dict(data, position + 4, end, opts)

    position += obj_size
    if "$ref" in obj:
        return (DBRef(obj.pop("$ref"), obj.pop("$id", None),
                      obj.pop("$db", None), obj), position)
    return obj, position
806309
def get_available_languages(self, obj, formset):
        
        if obj:
            # Inlines dictate language code, not the parent model.
            # Hence, not looking at obj.get_available_languages(), but see what languages
            # are used by the inline objects that point to it.
            filter = {
                'master__{0}'.format(formset.fk.name): obj
            }
            return self.model._parler_meta.root_model.objects.using(obj._state.db).filter(**filter) \
                   .values_list('language_code', flat=True).distinct().order_by('language_code')
        else:
            return self.model._parler_meta.root_model.objects.none()
728526
def get_object(self, id, **args):
        """"""
        return self.request("{0}/{1}".format(self.version, id), args)
824734
function() {
        return new Promise(function(resolve, reject) {
            try{
                resolve(library.listSourceLanguagesLastModified());
            } catch (err) {
                reject(err);
            }
        }).then(function(languages) {
            return listResourceContainers()
                .then(function(results) {
                    // flatten modified_at
                    let local = {};
                    for(let info of results) {
                        try {
                            if(!local[info.language.slug]) local[info.language.slug] = -1;
                            let old = local[info.language.slug];
                            local[info.language.slug] = info.modified_at > old ? info.modified_at : old;
                        } catch (err) {
                            console.error(err);
                        }
                    }
                    return inferUpdates(local, languages);
                });
        });
    }
1082196
def _get_object(data, position, obj_end, opts):
    """"""
    obj_size = _UNPACK_INT(data[position:position + 4])[0]
    end = position + obj_size - 1
    if data[end:position + obj_size] != b"\x00":
        raise InvalidBSON("bad eoo")
    if end >= obj_end:
        raise InvalidBSON("invalid object length")
    obj = _elements_to_dict(data, position + 4, end, opts, subdocument=True)

    position += obj_size
    if "$ref" in obj:
        return (DBRef(obj.pop("$ref"), obj.pop("$id", None),
                      obj.pop("$db", None), obj), position)
    return obj, position
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
672244
def get_translations(self, status=None):
        '''
            
        '''
        if status is not None:
            result = self.api_call('translation/?status=%s' % status)
        else:
            result = self.api_call('translation/')
        if result.status_code == 200:
            translations_json = json.loads(result.content)["objects"]
            translations = [Translation(**tj) for tj in translations_json]
        else:
            log.critical(
                'Error status when fetching translation from server: {'
                '}!'.format(
                    result.status_code))
            translations = []
        return translations
985781
def ensure_object(self, object_type):
        
        rv = self.find_object(object_type)
        if rv is None:
            self.obj = rv = object_type()
        return rv
176751
function lookup(locale, format, obj) {
  if (!locale) throw new Error('missing required "locale" parameter');
  locale = locale.toLowerCase().replace('-', '_');
  format = format || 'cardinal';
  var p = obj[format];
  if (!p) throw new Error('unsupported format "' + format + '"');
  var fn = p[locale] || p[locale.split('_')[0]];
  if (fn) return fn;

  throw new Error('unsupported locale "' + locale + '"');
}
677269
public Object get(ULocale locale, ULocale[] actualReturn) {
        return get(locale, LocaleKey.KIND_ANY, actualReturn);
    }
288510
def locale(self, value):
        """"""
        if not isinstance(value, Locale):
            value = Locale.parse(value)
        self.local.babel_locale = value
910449
def get_by_code(self, code):
        
        if any(x in code for x in ('_', '-')):
            cc = CultureCode.objects.get(code=code.replace('_', '-'))
            return cc.language

        elif len(code) == 2:
            return self.get(iso_639_1=code)

        elif len(code) == 3:
            return self.get(Q(iso_639_2T=code) |
                            Q(iso_639_2B=code) |
                            Q(iso_639_3=code))

        raise ValueError(
            'Code must be either 2, or 3 characters: "%s" is %s' % (code, len(code)))