-
Notifications
You must be signed in to change notification settings - Fork 25k
Add comment to clarify how I18nManager works #51661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
scarlac
wants to merge
1
commit into
facebook:main
Choose a base branch
from
scarlac:patch-i18n-rtl
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iOS I18nManager.isRTL is not wrong but often misinterpreted. Comment adds clarification to native call that Apple doesn't.
scarlac
pushed a commit
to scarlac/react-native-website
that referenced
this pull request
May 28, 2025
Added to sidebar as well. Related to facebook/react-native#51661 and facebook/react-native#51648
scarlac
pushed a commit
to scarlac/react-native-website
that referenced
this pull request
May 28, 2025
Added to sidebar as well. Related to facebook/react-native#51661 and facebook/react-native#51648
scarlac
pushed a commit
to scarlac/react-native-website
that referenced
this pull request
May 28, 2025
Added to sidebar as well. Related to facebook/react-native#51661 and facebook/react-native#51648
scarlac
pushed a commit
to scarlac/react-native-website
that referenced
this pull request
Jun 3, 2025
Added to sidebar as well. Related to facebook/react-native#51661 and facebook/react-native#51648
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>
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. |
Contributor
Author
|
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
.isRTLstarts returningtrue.Note that Xcode has a nasty caching bug that means that removing Hebrew:
.isRTLto revert behaviorThe 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.