def get_slug_in_language(record, language):
    """This is an adapter from django-hvad's lazy_translation_getter."""
    if not record or not hasattr(record, 'safe_translation_getter'):
        return None
    return record.safe_translation_getter(field='slug', language_code=
        language, default=None)
