diff --git a/React/Modules/RCTI18nUtil.m b/React/Modules/RCTI18nUtil.m index 40367574f33110..443c9930233d68 100644 --- a/React/Modules/RCTI18nUtil.m +++ b/React/Modules/RCTI18nUtil.m @@ -42,12 +42,15 @@ - (BOOL)isRTL /** * Should be used very early during app start up * Before the bridge is initialized + * @return whether the app allows RTL layout, default is true */ - (BOOL)isRTLAllowed { - BOOL rtlStatus = [[NSUserDefaults standardUserDefaults] - boolForKey:@"RCTI18nUtil_allowRTL"]; - return rtlStatus; + NSNumber *value = [[NSUserDefaults standardUserDefaults] objectForKey:@"RCTI18nUtil_allowRTL"]; + if (value == nil) { + return YES; + } + return [value boolValue]; } - (void)allowRTL:(BOOL)rtlStatus diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/I18nUtil.java b/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/I18nUtil.java index b6d8e75469fa1a..181e37f83558cb 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/I18nUtil.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/I18nUtil.java @@ -32,7 +32,7 @@ private I18nUtil() { } public static I18nUtil getInstance() { - if(sharedI18nUtilInstance == null) { + if (sharedI18nUtilInstance == null) { sharedI18nUtilInstance = new I18nUtil(); } return sharedI18nUtilInstance; @@ -55,9 +55,10 @@ public boolean isRTL(Context context) { /** * Should be used very early during app start up * Before the bridge is initialized + * @return whether the app allows RTL layout, default is true */ private boolean isRTLAllowed(Context context) { - return isPrefSet(context, KEY_FOR_PREFS_ALLOWRTL, false); + return isPrefSet(context, KEY_FOR_PREFS_ALLOWRTL, true); } public void allowRTL(Context context, boolean allowRTL) {