Skip to content

Commit 3eee96a

Browse files
ikenwoofacebook-github-bot
authored andcommitted
Change React Native application layout check
Reviewed By: shergin Differential Revision: D7076910 fbshipit-source-id: dc6df2dee886bbdf139d6e50192d621efad6d57e
1 parent bd30336 commit 3eee96a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

React/Modules/RCTI18nUtil.m

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
#import <Foundation/Foundation.h>
9-
108
#import "RCTI18nUtil.h"
119

10+
#import <UIKit/UIKit.h>
11+
1212
@implementation RCTI18nUtil
1313

1414
+ (instancetype)sharedInstance
@@ -98,9 +98,8 @@ - (BOOL)isDevicePreferredLanguageRTL
9898
// Check if the current application language is RTL
9999
- (BOOL)isApplicationPreferredLanguageRTL
100100
{
101-
NSString *preferredAppLanguage = [[[NSBundle mainBundle] preferredLocalizations] objectAtIndex:0];
102-
NSLocaleLanguageDirection direction = [NSLocale characterDirectionForLanguage:preferredAppLanguage];
103-
return direction == NSLocaleLanguageDirectionRightToLeft;
101+
NSWritingDirection direction = [NSParagraphStyle defaultWritingDirectionForLanguage:nil];
102+
return direction == NSWritingDirectionRightToLeft;
104103
}
105104

106105
@end

0 commit comments

Comments
 (0)