Skip to content

Commit 4a072ef

Browse files
committed
Upgraded project structure and compatibility fix with react-native 0.60
1 parent d0e0f1e commit 4a072ef

File tree

14 files changed

+74
-35
lines changed

14 files changed

+74
-35
lines changed

.babelrc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"presets": [
3-
[
4-
"env",
5-
[
6-
"es2015",
7-
{
8-
"modules": true
9-
}
10-
]
11-
]
2+
"presets": [
3+
[
4+
"env",
5+
[
6+
"es2015",
7+
{
8+
"modules": true
9+
}
10+
]
1211
]
13-
}
12+
]
13+
}

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,23 @@ It's possible to force a language different from the interface one.
3535
The easiest way to install is to type just 2 commands inside your react-native project folder and you are ready to go:
3636

3737
```
38-
npm install react-native-localization --save
38+
yarn add react-native-localization --save
39+
40+
#react-native >= 0.60
41+
cd ios && pod install && cd ..
42+
43+
#react-native < 0.60
3944
react-native link react-native-localization
4045
```
4146

47+
4248
Don´t forget to restart the app / node server or you will see an error.
4349

4450
If you're installing for Android and still experiencing problems check if
4551
step 4 of "Manual installation Android" has been automatically executed by the linker.
4652

53+
Check this [article](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md) about the new linking behaviour in react-native since version 0.60.
54+
4755
Windows platform doesn't support automatic installation by linker. Only manual installation is supported.
4856

4957
### Manual installation iOS

ReactNativeLocalization.podspec

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,19 @@ require 'json'
33
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
44

55
Pod::Spec.new do |s|
6-
s.name = 'ReactNativeLocalization'
7-
s.version = package['version']
8-
s.summary = package['description']
9-
s.description = package['description']
10-
s.homepage = package['homepage']
11-
s.license = package['license']
12-
s.author = package['author']
13-
s.source = { :git => 'https://github.com/stefalda/ReactNativeLocalization.git', :tag => 'v'+s.version.to_s }
6+
s.name = "ReactNativeLocalization"
7+
s.version = package['version']
8+
s.summary = package['description']
9+
s.homepage = "https://github.com/sfalda/ReactNativeLocalization"
10+
s.license = package['license']
11+
s.author = package['author']
12+
s.source = { :git => package['repository']['url'], :tag => "v#{s.version}" }
1413

15-
s.platform = :ios, '9.0'
1614
s.ios.deployment_target = '8.0'
15+
s.osx.deployment_target = '10.10'
1716

18-
s.dependency 'React'
17+
s.preserve_paths = 'README.md', 'LICENSE', 'package.json'
18+
s.source_files = "ios/*.{h,m}"
1919

20-
s.preserve_paths = 'CHANGELOG.md', 'LICENSE', 'package.json'
21-
s.source_files = '**/*.{h,m}'
22-
s.exclude_files = 'android/**/*'
23-
end
20+
s.dependency 'React'
21+
end
File renamed without changes.
File renamed without changes.

ReactNativeLocalization.xcodeproj/project.pbxproj renamed to ios/ReactNativeLocalization.xcodeproj/project.pbxproj

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
7B5D9D021B6AD0EA00CF3A83 /* Project object */ = {
8383
isa = PBXProject;
8484
attributes = {
85-
LastUpgradeCheck = 0800;
85+
LastUpgradeCheck = 1020;
8686
ORGANIZATIONNAME = "Stefano Falda";
8787
TargetAttributes = {
8888
7B5D9D091B6AD0EA00CF3A83 = {
@@ -92,10 +92,11 @@
9292
};
9393
buildConfigurationList = 7B5D9D051B6AD0EA00CF3A83 /* Build configuration list for PBXProject "ReactNativeLocalization" */;
9494
compatibilityVersion = "Xcode 3.2";
95-
developmentRegion = English;
95+
developmentRegion = en;
9696
hasScannedForEncodings = 0;
9797
knownRegions = (
9898
en,
99+
Base,
99100
);
100101
mainGroup = 7B5D9D011B6AD0EA00CF3A83;
101102
productRefGroup = 7B5D9D0B1B6AD0EA00CF3A83 /* Products */;
@@ -123,18 +124,27 @@
123124
isa = XCBuildConfiguration;
124125
buildSettings = {
125126
ALWAYS_SEARCH_USER_PATHS = NO;
127+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
126128
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
127129
CLANG_CXX_LIBRARY = "libc++";
128130
CLANG_ENABLE_MODULES = YES;
129131
CLANG_ENABLE_OBJC_ARC = YES;
132+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
130133
CLANG_WARN_BOOL_CONVERSION = YES;
134+
CLANG_WARN_COMMA = YES;
131135
CLANG_WARN_CONSTANT_CONVERSION = YES;
136+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
132137
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
133138
CLANG_WARN_EMPTY_BODY = YES;
134139
CLANG_WARN_ENUM_CONVERSION = YES;
135140
CLANG_WARN_INFINITE_RECURSION = YES;
136141
CLANG_WARN_INT_CONVERSION = YES;
142+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
143+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
144+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
137145
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
146+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
147+
CLANG_WARN_STRICT_PROTOTYPES = YES;
138148
CLANG_WARN_SUSPICIOUS_MOVE = YES;
139149
CLANG_WARN_UNREACHABLE_CODE = YES;
140150
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -176,18 +186,27 @@
176186
isa = XCBuildConfiguration;
177187
buildSettings = {
178188
ALWAYS_SEARCH_USER_PATHS = NO;
189+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
179190
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
180191
CLANG_CXX_LIBRARY = "libc++";
181192
CLANG_ENABLE_MODULES = YES;
182193
CLANG_ENABLE_OBJC_ARC = YES;
194+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
183195
CLANG_WARN_BOOL_CONVERSION = YES;
196+
CLANG_WARN_COMMA = YES;
184197
CLANG_WARN_CONSTANT_CONVERSION = YES;
198+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
185199
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
186200
CLANG_WARN_EMPTY_BODY = YES;
187201
CLANG_WARN_ENUM_CONVERSION = YES;
188202
CLANG_WARN_INFINITE_RECURSION = YES;
189203
CLANG_WARN_INT_CONVERSION = YES;
204+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
205+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
206+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
190207
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
208+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
209+
CLANG_WARN_STRICT_PROTOTYPES = YES;
191210
CLANG_WARN_SUSPICIOUS_MOVE = YES;
192211
CLANG_WARN_UNREACHABLE_CODE = YES;
193212
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0640"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -37,10 +37,10 @@
3737
</BuildActionEntries>
3838
</BuildAction>
3939
<TestAction
40+
buildConfiguration = "Debug"
4041
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4142
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
42-
shouldUseLaunchSchemeArgsEnv = "YES"
43-
buildConfiguration = "Debug">
43+
shouldUseLaunchSchemeArgsEnv = "YES">
4444
<Testables>
4545
<TestableReference
4646
skipped = "NO">
@@ -62,15 +62,18 @@
6262
ReferencedContainer = "container:ReactNativeLocalization.xcodeproj">
6363
</BuildableReference>
6464
</MacroExpansion>
65+
<AdditionalOptions>
66+
</AdditionalOptions>
6567
</TestAction>
6668
<LaunchAction
69+
buildConfiguration = "Debug"
6770
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
6871
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
6972
launchStyle = "0"
7073
useCustomWorkingDirectory = "NO"
71-
buildConfiguration = "Debug"
7274
ignoresPersistentStateOnLaunch = "NO"
7375
debugDocumentVersioning = "YES"
76+
debugServiceExtension = "internal"
7477
allowLocationSimulation = "YES">
7578
<MacroExpansion>
7679
<BuildableReference
@@ -85,10 +88,10 @@
8588
</AdditionalOptions>
8689
</LaunchAction>
8790
<ProfileAction
91+
buildConfiguration = "Release"
8892
shouldUseLaunchSchemeArgsEnv = "YES"
8993
savedToolIdentifier = ""
9094
useCustomWorkingDirectory = "NO"
91-
buildConfiguration = "Release"
9295
debugDocumentVersioning = "YES">
9396
<MacroExpansion>
9497
<BuildableReference

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,14 @@
3030
},
3131
"homepage": "https://github.com/stefalda/ReactNativeLocalization",
3232
"dependencies": {
33-
"react-localization": "^1.0.13",
34-
"react": "^16.0.0"
33+
"react-localization": "^1.0.14"
3534
},
3635
"devDependencies": {
3736
"babel-cli": "^6.26.0",
3837
"babel-preset-env": "^1.6.1"
38+
},
39+
"peerDependencies": {
40+
"react-native": "^0.41.2",
41+
"react-native-windows": "0.41.0-rc.1"
3942
}
4043
}

0 commit comments

Comments
 (0)