Change React Native application layout check

Reviewed By: shergin

Differential Revision: D7076910

fbshipit-source-id: dc6df2dee886bbdf139d6e50192d621efad6d57e
This commit is contained in:
Ken Woo 2018-02-26 11:35:51 -08:00 committed by Facebook Github Bot
parent bd30336d86
commit 3eee96ab86
1 changed files with 4 additions and 5 deletions

View File

@ -5,10 +5,10 @@
* LICENSE file in the root directory of this source tree.
*/
#import <Foundation/Foundation.h>
#import "RCTI18nUtil.h"
#import <UIKit/UIKit.h>
@implementation RCTI18nUtil
+ (instancetype)sharedInstance
@ -98,9 +98,8 @@
// Check if the current application language is RTL
- (BOOL)isApplicationPreferredLanguageRTL
{
NSString *preferredAppLanguage = [[[NSBundle mainBundle] preferredLocalizations] objectAtIndex:0];
NSLocaleLanguageDirection direction = [NSLocale characterDirectionForLanguage:preferredAppLanguage];
return direction == NSLocaleLanguageDirectionRightToLeft;
NSWritingDirection direction = [NSParagraphStyle defaultWritingDirectionForLanguage:nil];
return direction == NSWritingDirectionRightToLeft;
}
@end