Skip to content

Conversation

@scarlac
Copy link
Contributor

@scarlac scarlac commented May 28, 2025

iOS I18nManager.isRTL is not wrong but often misinterpreted.
This PR adds a comment to clarify what the native call does, since Apple doesn't.

Summary:

Undocumented behavior made me waste several hours hunting for an i18n issue that incorrectly made me think RN had a bug. It's impossible to know this code is working as intended as original commit does not state why the code exist, only that it was changed, no mentions in changelogs, and no official docs from neither RN nor from Apple explains the combined or individual behavior.

Changelog:

[iOS] [Added] - Added comment to clarify why i18nManager.isRTL may not return the expected value

Test Plan:

This project demonstrates that compiling and running will give you the "wrong"/unexpected isRTL value when using Hebrew
https://github.com/scarlac/rtl-test

When Hebrew is added to the Xcode project under "Internationalization" then you will observe that .isRTL starts returning true.

Note that Xcode has a nasty caching bug that means that removing Hebrew:

  1. Will Not remove Hebrew (you need to remove it twice)
  2. Will Not cause .isRTL to revert behavior

The solution is to remove Hebrew 2x, and then to clear DerivedData (or Product -> Clean Build Folder..., or CMD+Shift+K)

In addition to these issues, it's important to note that calling .forceRTL or .allowRTL are persisted across restarts. This is clearly intentional but also not clearly documented, so you cannot "clear" these states. A reinstall is necessary, or a counter-value call is necessary. The demo project does not use these calls, so it's not an issue there.

iOS I18nManager.isRTL is not wrong but often misinterpreted. Comment adds clarification to native call that Apple doesn't.
@facebook-github-bot facebook-github-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 May 28, 2025
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label May 28, 2025
scarlac pushed a commit to scarlac/react-native-website that referenced this pull request May 28, 2025
scarlac pushed a commit to scarlac/react-native-website that referenced this pull request May 28, 2025
scarlac pushed a commit to scarlac/react-native-website that referenced this pull request May 28, 2025
scarlac pushed a commit to scarlac/react-native-website that referenced this pull request Jun 3, 2025
Abbondanzo pushed a commit to facebook/react-native-website that referenced this pull request Jun 4, 2025
Added to sidebar as well.
Related to facebook/react-native#51661 and facebook/react-native#51648

Co-authored-by: Seph Soliman <sesoliman@tesla.com>
coado pushed a commit to coado/react-native-website that referenced this pull request Jun 30, 2025
Added to sidebar as well.
Related to facebook/react-native#51661 and facebook/react-native#51648

Co-authored-by: Seph Soliman <sesoliman@tesla.com>
@react-native-bot
Copy link
Collaborator

This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@react-native-bot react-native-bot added Stale There has been a lack of activity on this issue and it may be closed soon. and removed Stale There has been a lack of activity on this issue and it may be closed soon. labels Dec 2, 2025
@scarlac
Copy link
Contributor Author

scarlac commented Dec 2, 2025

Still relevant

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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants