Skip to content

Discuss adding i18n.setAcceptLanguages and i18n.appendAcceptLanguage #888

@carlosjeurissen

Description

@carlosjeurissen

Originally posted here https://source.chromium.org/chromium/chromium/src/+/main:docs/website/site/developers/design-documents/extensions/proposed-changes/apis-under-development/i18n-api/index.md?q=setAcceptLanguages&ss=chromium%2Fchromium%2Fsrc

Taken parts of said doc for this issue as starting point for discussion.

Overview

The i18n API allows you to manipulate the i18n related browser settings, such as
the accept languages.

Could this API be part of the web platform?

We would also like to be able to modify accept languages preferences as well by extension,
for example, it'd be nice if we could "learn" the accept-languages through
translate, such as if you decline to translate a French page, that would be a
good signal that you want it added to the accept-languages.

Do you expect this API to be fairly stable?

Yes*.*

Draft API spec

void setAcceptLanguages(Value newAcceptLanguages)

void appendAcceptLanguage(Value acceptLanguage)

Issues

  • Browser UI should be able to deal with valid BCP47 codes they do not offer in their own UI. This

Alternatives

  • Usage of DNR and main world content script hacks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions