Skip to content

DefaultLocale should continue returning a canonicalized language tag #991

@anba

Description

@anba

From https://w3c.github.io/webdriver-bidi/#command-emulation-setLocaleOverride:

If IsStructurallyValidLanguageTag(emulated locale) returns false, return error with error code invalid argument.

ECMA-402 DefaultLocale has more requirements:

  1. The language tag is also canonicalized. For example "EN" is structurally valid, but not in canonical case. Or "de-DD" is also structurally valid and even in canonical case, but still not a canonical language tag, because "DD" should be replaced with "DE".
  2. The default locale must be also be in [[AvailableLocales]] of all Intl service constructors, see https://tc39.es/ecma402/#sec-internal-slots. For example if the locale override is "nds", but the implementation doesn't ship locale data for Low German, than DefaultLocale must not return "nds".
  3. Furthermore language tags in [[AvailableLocales]] don't contain Unicode extension sequences, see https://tc39.es/ecma402/#available-locales-list. That means for example that "en-u-nu-latn" must be rejected as a locale override.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions