New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Short i18n review for WebGPU / WGSL #2546
Comments
Spec editors @kvark @kainino0x @toji @dneto0 @litherum PTAL! @kdashg PTAL too! This is part of the process of asking for an internationalization review for a specification. Feel free to edit the first comment with more info if needed. Once we're happy with the result we can add the |
Maybe briefly mention that object labels, debug group/marker names, WGSL |
Looks good, thanks for heading this up! |
You'll probably also want to mention that GPUCompilationMessage points at a location in a User-provided string by line number, position on the line, string offset, and length. This feels like the following list item but in reverse, so not sure if actually falls under that group.
|
Probably worth mentioning, please edit the top comment! |
Done. |
It might help to update this because #1160 (comment) is getting in the API and WGSL. |
Added above. |
It seems like the specifications might receive feedback due to the lack of presence of directionality and language information in natural language messages. So, in anticipation, here is a quick web specs recap of the situation with regards to the advancement of localization of these strings: Despite the ongoing discussion (see w3ctag/design-reviews#716 thread), WebIDL has no primary, tailor-cut interface for this for the time being. There already are a few specs that resolve this through appending "lang" (stands for WebIDLpedia is helpful for anybody looking to look up: https://dontcallmedom.github.io/webidlpedia/members.html The following text is a copy of w3ctag/design-reviews#716 (comment) comment by @aphillips as of posting, which I think is a helpful summary.
|
Closing this issue, I18n WG filed a bunch of feedback so we can continue the work in the individual issues. |
Short i18n review checklist is here
This review is for both WebGPU and WGSL since WGSL is a companion language to the WebGPU API.
If the spec (or its implementation) contains any natural language text that will be read by a human (this includes error messages or other UI text, JSON strings, etc, etc),
The WebGPU API contains several
DOMString
that are reasonably expected to be surfaced to a human:GPUCompilationMessage.message which is a compiler message from the WGSL compiler.
GPUDeviceLostInfo.message that may describe in human-readable language the reason why the GPU was lost (it was disconnect, timed out, etc).
GPUValidationError.message which describe in human-readable language what error happened (similarly to
DOMException.message
, see the explainer for why it is different)GPUCompilationMessage points at a location in a user-provided string by line number, position on the line, string offset, and length.
The WebGPU adapter identifier, depending on the resolution surrounding the GPU Adapter Identifier discussions. The information surfaced to the user may contain the GPU's vendor name, chip name, or other information.
The expectation is to use "first-strong" augmented with Unicode markers if need be. The implementations will have to decide when to add the markers.
If the spec (or its implementation) allows content authors to produce typographically appealing text, either in its own right, or in association with graphics.
N/A WebGPU/WGSL doesn't allow producing text (unless Javascript uses WebGPU to draw text, but that's not decidable at the WebGPU level)
If the spec (or its implementation) allows the user to point into text, creates text fragments, concatenates text, allows the user to select or step through text (using a cursor or other methods), etc.
N/A WebGPU/WGSL doesn't allow working with text.
If the spec (or its implementation) allows searching or matching of text, including syntax and identifiers
WebGPU has an associated shading language, WGSL. WGSL allows any Unicode in comments and UAX31 XID_Start and XID_Continue in identifiers. Identifiers in the WGSL store and compare by their code points and not through UAX15 equivalences such as canonical or compatibility. But where relevant, including places within WebGPU API, user agents are strongly encouraged to display a developer-visible warning when there are non-reader-visible code point differences, such as non-normalized code point sequences.
WGSL and WGSL identifiers are relevant inside parsing of WGSL, as well as in the WebGPU API GPUShaderModuleDescriptor.code/sourceMap/hints and GPUProgrammableStage.entryPoint/constants members.
If the spec (or its implementation) sorts text
N/A WebGPU doesn't sort text.
If the spec (or its implementation) captures user input
N/A WebGPU doesn't capture user input.
If the spec (or its implementation) deals with time in any way that will be read by humans and/or crosses time zone boundaries
N/A WebGPU only deals with time in the timestamp queries, and they return nanosecond timestamps that are not related to any particular origin (it may be Unix epoch, or since the computer was booted, or the GPU booted, or anything else).
If the spec (or its implementation) allows any character encoding other than UTF-8.
WGSL source code is specified in GPUShaderModuleDescriptor.code as
USVString
. WGSL uses UTF-8 encoding and only disallows the null character. Comments can contain any Unicode character, and identifiers can contain XID_Start or_
low line at first character and XID_Continue for the rest from UAX31, which is the Unicode recommendation for Identifiers.All other strings (labels, debug group names, entry point names, etc) are developer-defined strings.
If the spec (or its implementation) defines markup.
N/A WebGPU doesn't define markup.
If the spec (or its implementation) deals with names, addresses, time & date formats, etc
N/A WebGPU doesn't deal with such information.
If the spec (or its implementation) describes a format or data that is likely to need localization.
N/A WebGPU doesn't define a format other than WGSL.
If the spec (or its implementation) makes any reference to or relies on any cultural norms
N/A WebGPU doesn't reference cultural norms (as far as we know).
The text was updated successfully, but these errors were encountered: