Skip to content

RFC: Host locale subscription #527

Description

@kalininilya

Source PR: #526 · docs/rfcs/host-locale-subscription.md · @kalininilya

Description

locale.subscribe() pushes the language the host presents its interface in, as a BCP 47 tag, on subscribe and on every change. Products render in that language instead of inferring one.

Motivation

A product cannot tell which language its host is running in. navigator.language reports the operating system's preference, which is wrong whenever the user picked a different language inside the host — the case that setting exists for.

Requirements

  • language_tag is an open BCP 47 string, not an enum: hosts add languages without a protocol change.
  • A product that does not ship the tag it receives picks its own fallback; the host does not negotiate one.
  • Emits the current locale immediately on subscribe, then on every change.
  • No permission gate and no pairing requirement — products need it on first paint.
  • LocaleHost is a required Platform trait, so a host serves a real value rather than Unsupported.

Tasks

  • RFC document body
  • Implementation — rust-core
  • Implementation — hosts
    • dotli
    • Desktop
    • iOS
    • Android
    • host-cli

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