Visitar URL original
[selectors-4] `language-range` is missing its definition · Issue #13646 · w3c/csswg-drafts · GitHub
Skip to content

[selectors-4] language-range is missing its definition #13646

Closed

Description

@aphillips

7.2. The Language Pseudo-class: :lang()
https://www.w3.org/TR/2026/WD-selectors-4-20260122/#language-range

Each language range in :lang() must be a valid CSS or . (Thus language ranges containing asterisks, for example, must be either correctly escaped or quoted as strings, e.g. :lang(*-Latn) or :lang("*-Latn").)

The <dfn> for "language range" has no definition and really it should provide one. Either it should be linked to the one in I18N Glossary (here), to the definition of an extended language range in BCP47 (in the RFC4647 part), or it should provide one locally.

Activity

  1. added
    i18n-needs-resolutionIssue the Internationalization Group has raised and looks for a response on.
    on Mar 12, 2026
  2. svgeesus commented on Mar 12, 2026

    @svgeesus
    Collaborator

    Certainly a definition should be linked to.

    The I18n glossary entry seems imprecise ("similar to"):

    A string similar in structure to a language tag that is used for "identifying sets of language tags that share specific attributes".

  3. svgeesus commented on Mar 12, 2026

    @svgeesus
    Collaborator

    The definition from BCP47 looks crisper, with a defined grammar:

    Occasionally, users will wish to select a set of language tags based
    on the presence of specific subtags. An "extended language range"
    describes a user's language preference as an ordered sequence of
    subtags. For example, a user might wish to select all language tags
    that contain the region subtag 'CH' (Switzerland). Extended language
    ranges are useful for specifying a particular sequence of subtags
    that appear in the set of matching tags without having to specify all
    of the intervening subtags.

    An extended language range can be represented by the following ABNF:

    extended-language-range = (1*8ALPHA / "*")
    *("-" (1*8alphanum / "*"))

    The wildcard subtag '*' can occur in any position in the extended
    language range, where it matches any sequence of subtags that might
    occur in that position in a language tag. However, wildcards outside
    the first position are ignored by Extended Filtering (see Section
    3.2.2). The use or absence of one or more wildcards cannot be taken
    to imply that a certain number of subtags will appear in the matching
    set of language tags.

    @fantasai @tabatkins do you agree that a link to the BCP47 definition of Extended Language Range should be added?

  4. svgeesus commented on Mar 31, 2026

    @svgeesus
    Collaborator

    @aphillips pull request to fix this, could you review?

  5. added
    Commenter SatisfiedCommenter has indicated satisfaction with the resolution / edits.
    and removed on Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closed Accepted as Obvious BugfixFixed an obvious error with the obvious solution.Commenter SatisfiedCommenter has indicated satisfaction with the resolution / edits.i18n-needs-resolutionIssue the Internationalization Group has raised and looks for a response on.selectors-4Current Work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions