Move Bridge functions to OSS -- RTL experiment

Summary:
Delete the bridge functions(isRTL, allowRTL()) in internal module and move to OSS.
 Create bridge for RCTI18nUtil

Reviewed By: fkgozali

Differential Revision: D3519224

fbshipit-source-id: 3853edcfcc78777d957874448117de72ae0700b5
This commit is contained in:
Mengjue Wang 2016-07-06 16:26:59 -07:00 коммит произвёл Facebook Github Bot 1
Родитель a7d032b707
Коммит e209f2f1e9
3 изменённых файлов: 54 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,19 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "RCTBridgeModule.h"
/**
* @experimental
* This is a experimental module for RTL support
* This module bridges the i18n utility from RCTI18nUtil
*/
@interface RCTI18nManager : NSObject <RCTBridgeModule>
@end

Просмотреть файл

@ -0,0 +1,29 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "RCTI18nManager.h"
#import "RCTI18nUtil.h"
@implementation RCTI18nManager
RCT_EXPORT_MODULE()
RCT_EXPORT_METHOD(allowRTL:(BOOL)value)
{
[[RCTI18nUtil sharedInstance] setAllowRTL:value];
}
- (NSDictionary *)constantsToExport
{
return @{
@"isRTL": @([[RCTI18nUtil sharedInstance] isRTL])
};
}
@end

Просмотреть файл

@ -96,6 +96,7 @@
83CBBA981A6020BB00E9B192 /* RCTTouchHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA971A6020BB00E9B192 /* RCTTouchHandler.m */; };
83CBBACC1A6023D300E9B192 /* RCTConvert.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBACB1A6023D300E9B192 /* RCTConvert.m */; };
85C199EE1CD2407900DAD810 /* RCTJSCWrapper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85C199ED1CD2407900DAD810 /* RCTJSCWrapper.mm */; };
B233E6EA1D2D845D00BC68BA /* RCTI18nManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B233E6E91D2D845D00BC68BA /* RCTI18nManager.m */; };
B95154321D1B34B200FE7B80 /* RCTActivityIndicatorView.m in Sources */ = {isa = PBXBuildFile; fileRef = B95154311D1B34B200FE7B80 /* RCTActivityIndicatorView.m */; };
E9B20B7B1B500126007A2DA7 /* RCTAccessibilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E9B20B7A1B500126007A2DA7 /* RCTAccessibilityManager.m */; };
/* End PBXBuildFile section */
@ -310,6 +311,8 @@
85C199EC1CD2407900DAD810 /* RCTJSCWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJSCWrapper.h; sourceTree = "<group>"; };
85C199ED1CD2407900DAD810 /* RCTJSCWrapper.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = RCTJSCWrapper.mm; sourceTree = "<group>"; };
ACDD3FDA1BC7430D00E7DE33 /* RCTBorderStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBorderStyle.h; sourceTree = "<group>"; };
B233E6E81D2D843200BC68BA /* RCTI18nManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTI18nManager.h; sourceTree = "<group>"; };
B233E6E91D2D845D00BC68BA /* RCTI18nManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTI18nManager.m; sourceTree = "<group>"; };
B95154301D1B34B200FE7B80 /* RCTActivityIndicatorView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTActivityIndicatorView.h; sourceTree = "<group>"; };
B95154311D1B34B200FE7B80 /* RCTActivityIndicatorView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTActivityIndicatorView.m; sourceTree = "<group>"; };
E3BBC8EB1ADE6F47001BBD81 /* RCTTextDecorationLineType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTTextDecorationLineType.h; sourceTree = "<group>"; };
@ -377,6 +380,8 @@
13723B4F1A82FD3C00F88898 /* RCTStatusBarManager.m */,
352DCFEE1D19F4C20056D623 /* RCTI18nUtil.h */,
352DCFEF1D19F4C20056D623 /* RCTI18nUtil.m */,
B233E6E91D2D845D00BC68BA /* RCTI18nManager.m */,
B233E6E81D2D843200BC68BA /* RCTI18nManager.h */,
13D9FEEC1CDCD93000158BD7 /* RCTKeyboardObserver.h */,
13D9FEED1CDCD93000158BD7 /* RCTKeyboardObserver.m */,
13B07FED1A69327A00A75B9A /* RCTTiming.h */,
@ -749,6 +754,7 @@
13E067571A70F44B002CDEE1 /* RCTView.m in Sources */,
13AFBCA01C07247D00BBAEAA /* RCTMapOverlay.m in Sources */,
13D9FEEE1CDCD93000158BD7 /* RCTKeyboardObserver.m in Sources */,
B233E6EA1D2D845D00BC68BA /* RCTI18nManager.m in Sources */,
13456E931ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m in Sources */,
137327E91AA5CF210034F82E /* RCTTabBarItemManager.m in Sources */,
13A1F71E1A75392D00D3D453 /* RCTKeyCommands.m in Sources */,