Skip to content

Commit 421e6ae

Browse files
scarlacSeph Soliman
authored andcommitted
Add comment to clarify how I18nManager works
iOS I18nManager.isRTL is not wrong but often misinterpreted. Comment adds clarification to native call that Apple doesn't.
1 parent 7ef278a commit 421e6ae

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/react-native/React/Modules/RCTI18nUtil.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ - (BOOL)isDevicePreferredLanguageRTL
9595
return direction == NSLocaleLanguageDirectionRightToLeft;
9696
}
9797

98-
// Check if the current application language is RTL
98+
// Intersect Xcode "Localization" languages with the system languages and checks if the result is using RTL
99+
// For RTL support, app must add an RTL lang to .pbxproj's knownRegions = ( ... )
100+
// and user must have chosen an RTL language
99101
- (BOOL)isApplicationPreferredLanguageRTL
100102
{
101103
NSWritingDirection direction = [NSParagraphStyle defaultWritingDirectionForLanguage:nil];

0 commit comments

Comments
 (0)