From 421e6ae0b9f03535b72777c57333c2cfd42557a2 Mon Sep 17 00:00:00 2001 From: Seph Soliman Date: Tue, 27 May 2025 14:25:33 -0700 Subject: [PATCH] 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. --- packages/react-native/React/Modules/RCTI18nUtil.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react-native/React/Modules/RCTI18nUtil.m b/packages/react-native/React/Modules/RCTI18nUtil.m index f77cb0c103bf..f1a41772d2d7 100644 --- a/packages/react-native/React/Modules/RCTI18nUtil.m +++ b/packages/react-native/React/Modules/RCTI18nUtil.m @@ -95,7 +95,9 @@ - (BOOL)isDevicePreferredLanguageRTL return direction == NSLocaleLanguageDirectionRightToLeft; } -// Check if the current application language is RTL +// Intersect Xcode "Localization" languages with the system languages and checks if the result is using RTL +// For RTL support, app must add an RTL lang to .pbxproj's knownRegions = ( ... ) +// and user must have chosen an RTL language - (BOOL)isApplicationPreferredLanguageRTL { NSWritingDirection direction = [NSParagraphStyle defaultWritingDirectionForLanguage:nil];