def lang(style, name, values):
    """Compute the ``lang`` property."""
    if values == 'none':
        return None
    else:
        name, key = values
        if name == 'attr()':
            return style.element.get(key) or None
        elif name == 'string':
            return key
Compute the ``lang`` property.
weasyprint/css/computed_values.py