def sort_validator(status):
    """Check if the entry is properly sorted."""
    if status.previous is None:
        return True
    if status.previous.msgid == status.entry.msgid:
        previous_msgctx = status.previous.msgctxt or ''
        entry_msgctxt = status.entry.msgctxt or ''
        return previous_msgctx < entry_msgctxt
    else:
        return status.previous.msgid < status.entry.msgid
