File tree Expand file tree Collapse file tree 4 files changed +20
-20
lines changed
main/java/com/localizationsettings Expand file tree Collapse file tree 4 files changed +20
-20
lines changed Original file line number Diff line number Diff line change @@ -96,10 +96,10 @@ class LocalizationSettingsModule internal constructor(context: ReactApplicationC
9696 /* *
9797 * Expose constants to react-native
9898 **/
99- override fun getTypedExportedConstants (): MutableMap <String , String ?>? {
100- val constants : MutableMap < String , String ?> = HashMap ()
101- constants[ " language" ] = getCurrentLanguage()
102- return constants
99+ override fun getTypedExportedConstants (): Map <String , String ?> {
100+ return mapOf (
101+ " language" to getCurrentLanguage()
102+ )
103103 }
104104
105105 /* *
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ abstract class LocalizationSettingsSpec internal constructor(context: ReactAppli
1010 abstract fun getLanguage (promise : Promise )
1111 abstract fun setLanguage (language : String )
1212 abstract fun getTypedExportedConstants (): Map <String , String ?>?
13-
1413 override fun getConstants (): Map <String , String ?>? {
1514 return getTypedExportedConstants()
1615 }
Original file line number Diff line number Diff line change @@ -50,20 +50,30 @@ - (void)setCurrentLanguage:(NSString *)lang {
5050 [[NSUserDefaults standardUserDefaults ] synchronize ];
5151}
5252
53+
54+ - (void )getLanguage : (RCTPromiseResolveBlock)resolve reject : (RCTPromiseRejectBlock)reject {
55+ resolve ([self getCurrentLanguage ]);
56+ }
57+
58+
59+ - (void )setLanguage : (NSString *)lang {
60+ [self setCurrentLanguage: lang];
61+ }
62+
5363/* *
5464 * Expose functions to react-native
5565 **/
5666RCT_REMAP_METHOD (getLanguage,
5767 withResolver:(RCTPromiseResolveBlock)resolve
5868 withReject:(RCTPromiseRejectBlock)reject)
5969{
60- resolve ( [self getCurrentLanguage ]) ;
70+ return [self getLanguage: resolve reject: reject] ;
6171}
6272
6373RCT_REMAP_METHOD (setLanguage,
6474 language:(NSString *)lang)
6575{
66- [self setCurrentLanguage : lang];
76+ return [self setLanguage : lang];
6777}
6878
6979/* *
Original file line number Diff line number Diff line change 11require "json"
22
33package = JSON . parse ( File . read ( File . join ( __dir__ , "package.json" ) ) )
4- folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
54
65Pod ::Spec . new do |s |
76 s . name = "react-native-localization-settings"
@@ -18,18 +17,10 @@ Pod::Spec.new do |s|
1817
1918 s . dependency "React-Core"
2019
21- # Don't install the dependencies when we run `pod install` in the old architecture.
2220 if ENV [ 'RCT_NEW_ARCH_ENABLED' ] == '1' then
23- s . compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
24- s . pod_target_xcconfig = {
25- "HEADER_SEARCH_PATHS" => "\" $(PODS_ROOT)/boost\" " ,
26- "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1" ,
27- "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
28- }
29- s . dependency "React-Codegen"
30- s . dependency "RCT-Folly"
31- s . dependency "RCTRequired"
32- s . dependency "RCTTypeSafety"
33- s . dependency "ReactCommon/turbomodule/core"
21+ install_modules_dependencies ( s )
22+ else
23+ s . dependency 'React-Core'
3424 end
25+
3526end
You can’t perform that action at this time.
0 commit comments