Skip to content

Commit 0c81858

Browse files
MengjueWFacebook Github Bot 6
authored andcommitted
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
1 parent 229d6d2 commit 0c81858

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

React/Modules/RCTI18nUtil.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
@interface RCTI18nUtil : NSObject
1919

2020
- (BOOL)isRTL;
21-
- (BOOL)forceRTL;
22-
- (void)setForceRTL:(BOOL)value;
21+
- (BOOL)allowRTL;
22+
- (void)setAllowRTL:(BOOL)value;
2323
+ (id)sharedInstance;
2424

2525
@end

React/Modules/RCTI18nUtil.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,26 @@ + (id)sharedInstance {
2222
return sharedRCTI18nUtilInstance;
2323
}
2424

25-
// If currnent using language is RTL language and meanwhile set forceRTL on the JS side,
25+
// If current using language is RTL language and meanwhile set allowRTL on the JS side,
2626
// the RN app will automatically have a RTL layout.
2727
- (BOOL)isRTL
2828
{
29-
if ([self forceRTL] && [self isApplicationPreferredLanguageRTL]) {
29+
if ([self allowRTL] && [self isApplicationPreferredLanguageRTL]) {
3030
return YES;
3131
}
3232
return NO;
3333
}
3434

35-
- (BOOL)forceRTL
35+
- (BOOL)allowRTL
3636
{
3737
BOOL rtlStatus = [[NSUserDefaults standardUserDefaults]
38-
boolForKey:@"RCTI18nUtil_forceRTL"];
38+
boolForKey:@"RCTI18nUtil_allowRTL"];
3939
return rtlStatus;
4040
}
4141

42-
- (void)setForceRTL:(BOOL)rtlStatus
42+
- (void)setAllowRTL:(BOOL)rtlStatus
4343
{
44-
[[NSUserDefaults standardUserDefaults] setBool:rtlStatus forKey:@"RCTI18nUtil_forceRTL"];
44+
[[NSUserDefaults standardUserDefaults] setBool:rtlStatus forKey:@"RCTI18nUtil_allowRTL"];
4545
[[NSUserDefaults standardUserDefaults] synchronize];
4646
}
4747

0 commit comments

Comments
 (0)