Re: [heycam/webidl] Exceptions not localizable (#1024)

`DOMException` has `name`, which behaves as a locale-neutral identifier (the fact that it's a string is fine--it just basically functions as an open-ended enum). I'm totally cool with `name` and think that specifications should define named exceptions. A named exception + data can be used to create localized messages on the client side with no fingerprinting and no need for language negotiation, etc. This is what I18N recommends to specifications. But...

But `DOMException` also has `message` which is "just a string" and is meant to be human-readable. I suppose localizing the message is a potential fingerprinting vector (to the degree that negotiating language/locale with anyone is a fingerprinting vector). Hardcoding all messages in English is not internationalized--I think our WG would prefer to provide for localization when it can be available?

IIRC, DOMException's [ctor](https://developer.mozilla.org/en-US/docs/Web/API/DOMException/DOMException) encourages the creation of `message` by not providing a `name`-only ctor.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/1024#issuecomment-924258922

Received on Tuesday, 21 September 2021 18:36:30 UTC