这是indexloc提供的服务,不要输入任何密码
Skip to content

Internationalization Metadata for Human-readable Messages #2780

@mehmetoguzderin

Description

@mehmetoguzderin

In WebGPU spec, there are a few places where API includes a message attribute that will hold a natural language, human-readable string. There is no explicit limitation on which language and directionality these messages will have (assumption is English and left-to-right), which means the UA can localize these messages, and the config can change anytime during the browsing experience (hence attributes live with the message). Under such an assumption, the first-strong approach does not have a recommendation, and this information should be simply two attributes of metadata: language (lang) and directionality (dir). A common way to resolve is to have lang and dir as attributes sit next to the message (preceding or succeeding). This way is also similar to what JSON-LD does. The following style but for all such interfaces:

[Exposed=(Window, DedicatedWorker), SecureContext]
interface GPUValidationError {
    constructor(DOMString message);
    readonly attribute DOMString message;
    readonly attribute DOMString lang;
    readonly attribute DOMString dir; // can be enum, only possible values are "ltr" and "rtl"
};

Also see: w3ctag/design-reviews#716 (comment)

And: w3c/i18n-activity#996 (comment)

This issue is in anticipation of w3c/i18n-activity#1503 feedback.

cc: @Kangz @xfq

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiWebGPU APIi18n-needs-resolutionIssue the Internationalization Group has raised and looks for a response on.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions