Skip to content

Do locale resolution in embedders #47087

@mehmetf

Description

@mehmetf

Internal: b/146064414

There are many internal issues/questions/confusion around how Flutter does locale resolution. While we provide a way to override our basic resolution algorithm, developers want resolution behavior that is consistent with the underlying platform which is very tricky to achieve with x-plat code.

I have talked to @GaryQian and @jason-simmons about this and we sketched out a plan to provide additional information from embedders on each platform to Dart code. Currently, embedders provide only the user select system locale (if exists). In addition, we propose that embedders provide:

  • The list of locales that the application supports.
  • The list of ordered locales that the system recommends (a strict subset of the above).

Today, #1 is specified in Dart. However, it is also duplicated in Info.plist file on iOS. We need to figure out a way to pass a list of supported locales to embedder at build time. This will ensure we have a single source of truth for supported locales. pubspec is the current proposed way.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: internationalizationSupporting other languages or locales. (aka i18n)c: new featureNothing broken; request for a new capabilityengineflutter/engine related. See also e: labels.waiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions