Skip to content

Poor description of :lang() psuedo class selector [css-3] [selectors-3] #3022

@GLRoylance

Description

@GLRoylance

https://drafts.csswg.org/selectors-3/#lang-pseudo

The draft says

The pseudo-class :lang(C) represents an element that is in language C. Whether an element is represented by a :lang() selector is based solely on the element's language value (normalized to BCP 47 syntax if necessary) being equal to the identifier C, or beginning with the identifier C immediately followed by "-" (U+002D). The matching of C against the element's language value is performed case-insensitively within the ASCII range. The identifier C does not have to be a valid language name.

The "normalized to BCP 47 syntax if necessary" opens a can of worms. It implies that the user agent should take locale strings such as "en_US" or "it_IT.utf8" and normalize them to BCP 47's syntax if necessary (which would be "en-US" and "it-IT"). Please do not suggest that an element's language can be set with xml:lang="en_US" or lang="it_IT.utf8" and the user agent will "normalize" it to a BCP 47 language tag.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions