Skip to content

Use ConfigurationCompat for device locale lookup - #58723

Closed
shreeshga wants to merge 1 commit into
react:mainfrom
shreeshga:export-D122147089
Closed

shreeshga wants to merge 1 commit into
react:mainfrom
shreeshga:export-D122147089

Conversation

@shreeshga

Copy link
Copy Markdown

Summary:
I18nUtil directly called Configuration.getLocales(), which is unavailable before API 24. Read the preferred locale through ConfigurationCompat instead and fall back to the process default when the locale list is empty.

Add an API-23 Robolectric regression test that exercises RTL detection on an Arabic locale.

Changelog:
[Android][Fixed] - Prevent a crash when resolving RTL layout direction on Android 6

Reviewed By: cortinico

Differential Revision: D122147089

Summary:
`I18nUtil` directly called `Configuration.getLocales()`, which is unavailable before API 24. Read the preferred locale through `ConfigurationCompat` instead and fall back to the process default when the locale list is empty.

Add an API-23 Robolectric regression test that exercises RTL detection on an Arabic locale.

Changelog:
[Android][Fixed] - Prevent a crash when resolving RTL layout direction on Android 6

Reviewed By: cortinico

Differential Revision: D122147089
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 28, 2026
@meta-codesync

meta-codesync Bot commented Sep 28, 2026

Copy link
Copy Markdown

@shreeshga has exported this pull request. If you are a Meta employee, you can view the originating Diff in D122147089.

@cortinico cortinico left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync meta-codesync Bot closed this in eaa9d7f Sep 28, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Sep 28, 2026
@meta-codesync

meta-codesync Bot commented Sep 28, 2026

Copy link
Copy Markdown

This pull request has been merged in eaa9d7f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants