mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-29 15:59:39 +08:00
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
This commit is contained in:
committed by
Facebook Github Bot 6
parent
229d6d2fd0
commit
0c818586ca
@@ -18,8 +18,8 @@
|
||||
@interface RCTI18nUtil : NSObject
|
||||
|
||||
- (BOOL)isRTL;
|
||||
- (BOOL)forceRTL;
|
||||
- (void)setForceRTL:(BOOL)value;
|
||||
- (BOOL)allowRTL;
|
||||
- (void)setAllowRTL:(BOOL)value;
|
||||
+ (id)sharedInstance;
|
||||
|
||||
@end
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user