def METHOD_NAME(self, name, data):
    current_language = settings.LANGUAGE_CODE
    localized_field_values = data.get(name, {}).get("localized", {})
    for locale, name in localized_field_values.items():
        split_locale = locale.partition("_")[0]
        if split_locale == current_language:
            result = name
            break
    else:  # try to return first one, if it exists
        try:
            result = list(localized_field_values.items())[0][-1]
        except IndexError:
            result = ""
    return result