-
Notifications
You must be signed in to change notification settings - Fork 329
Description
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.