'Validates library version'

def _validate_library_version(self, validation, lib_tools, version, library_key):

    latest_version = lib_tools.get_library_version(library_key)
    if (latest_version is not None):
        if ((version is None) or (version != unicode(latest_version))):
            validation.set_summary(StudioValidationMessage(StudioValidationMessage.WARNING, _(u'This    component    is    out    of    date.    The    library    has    new    content.'), action_class='library-update-btn', action_label=_(u'{refresh_icon}    Update    now.').format(refresh_icon=u'\u21bb')))
            return False
    else:
        validation.set_summary(StudioValidationMessage(StudioValidationMessage.ERROR, _(u'Library    is    invalid,    corrupt,    or    has    been    deleted.'), action_class='edit-button', action_label=_(u'Edit    Library    List.')))
        return False
    return True
