Skip to content

Local Dictionary: be clear about language tag processing #44

Description

@domenic

Language tags are complicated. If my page is set to lang="en-US", and I add dictionary entries for the following languages, what happens?

  • en
  • en-us (lowercase)
  • en-GB
  • en-asdf
  • en-US-x-lolcat
  • en-US-oed
  • en-Latn
  • en-Brai

Exact string matching is generally not the correct approach for this sort of thing.

We struggled with this in various AI-related APIs (see webmachinelearning/translation-api#11) and ended up with some of the specification infrastructure in https://webmachinelearning.github.io/writing-assistance-apis/#supporting-language-tags and https://webmachinelearning.github.io/writing-assistance-apis/#supporting-language-availability , which might be helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions