From 0c818586ca62b439320d906fc3af0ee6d580abd2 Mon Sep 17 00:00:00 2001 From: Mengjue Wang Date: Mon, 27 Jun 2016 12:57:45 -0700 Subject: [PATCH] Change forceRTL to allowRTL Summary: Rename the forceRTL to allowRTL so that make it much clear to read. And change a typo. Reviewed By: fkgozali Differential Revision: D3489235 fbshipit-source-id: b9803dfbcda2f764b7e752c9810cfc7a0b9fe39b --- React/Modules/RCTI18nUtil.h | 4 ++-- React/Modules/RCTI18nUtil.m | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/React/Modules/RCTI18nUtil.h b/React/Modules/RCTI18nUtil.h index ae4327938..a5865bd7c 100644 --- a/React/Modules/RCTI18nUtil.h +++ b/React/Modules/RCTI18nUtil.h @@ -18,8 +18,8 @@ @interface RCTI18nUtil : NSObject - (BOOL)isRTL; -- (BOOL)forceRTL; -- (void)setForceRTL:(BOOL)value; +- (BOOL)allowRTL; +- (void)setAllowRTL:(BOOL)value; + (id)sharedInstance; @end diff --git a/React/Modules/RCTI18nUtil.m b/React/Modules/RCTI18nUtil.m index 95c8ed735..72c5f5b06 100644 --- a/React/Modules/RCTI18nUtil.m +++ b/React/Modules/RCTI18nUtil.m @@ -22,26 +22,26 @@ return sharedRCTI18nUtilInstance; } -// If currnent using language is RTL language and meanwhile set forceRTL on the JS side, +// If current using language is RTL language and meanwhile set allowRTL on the JS side, // the RN app will automatically have a RTL layout. - (BOOL)isRTL { - if ([self forceRTL] && [self isApplicationPreferredLanguageRTL]) { + if ([self allowRTL] && [self isApplicationPreferredLanguageRTL]) { return YES; } return NO; } -- (BOOL)forceRTL +- (BOOL)allowRTL { BOOL rtlStatus = [[NSUserDefaults standardUserDefaults] - boolForKey:@"RCTI18nUtil_forceRTL"]; + boolForKey:@"RCTI18nUtil_allowRTL"]; return rtlStatus; } -- (void)setForceRTL:(BOOL)rtlStatus +- (void)setAllowRTL:(BOOL)rtlStatus { - [[NSUserDefaults standardUserDefaults] setBool:rtlStatus forKey:@"RCTI18nUtil_forceRTL"]; + [[NSUserDefaults standardUserDefaults] setBool:rtlStatus forKey:@"RCTI18nUtil_allowRTL"]; [[NSUserDefaults standardUserDefaults] synchronize]; }