xcmultilingual 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a2372792beae3590ed2ee82791da95304e301d83
4
- data.tar.gz: f5f63f39c161ca04ccd4e66f41dd5f0dbbb3e361
3
+ metadata.gz: 3896048efd650ae35d2065f4d2de541becf19c29
4
+ data.tar.gz: a00c7c75a4aa23c7f133a7bbe7bfc26884efd0b5
5
5
  SHA512:
6
- metadata.gz: d201551fca3884726658b60aa59c9af4c8ca185a2318a7cd57ec182f378dc930527d7c76f624e52b8118f27288200204cacad34354766f4786456d4fa5cf8287
7
- data.tar.gz: 1cc824397daa7760e649b6fd771383d7f99cc85e4321fce166b24be4baf9dba34720166b8c9cb10ef21b5fcd3d9b42842998dcbba492e709976c0f3bc178caaf
6
+ metadata.gz: a5a2cab190c4683a29f7ae849d855e22a5bbdf3ef6aed05eca67e197bb6061240edaa56af531acd3bcf498d8deeb3721203b26ede7438e5e0d9772a4786998a3
7
+ data.tar.gz: 67bae7a0720f0350e1427349c72209a2bf36f55fed42c3ba192a71348d7a6da852d14102bb608534897e5de9c6e584d4ea145d48750509e821f09affa17b4fdd
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.3.1 Release Notes 2015-7-25
4
+
5
+ - Improvement: Stop using `NSBundle.mainBundle()`. Now using class name for deciding project's bundle.
6
+ - Update command logs.
7
+
3
8
  ## 0.3.0 Release Notes 2015-7-25
4
9
 
5
10
  - **Breaking change:** Translated value is now not from `string()` function but just `value` computed property in swift template.
@@ -8,6 +8,7 @@
8
8
 
9
9
  /* Begin PBXBuildFile section */
10
10
  010351D27DA148AE9479B314 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 296E088C215EBFAA6DFD16F8 /* Pods.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
11
+ 901F30E91B63C0550049FC83 /* sample2.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 901F30E81B63C0550049FC83 /* sample2.bundle */; };
11
12
  905547781B50D3BD003A766C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 905547771B50D3BD003A766C /* AppDelegate.swift */; };
12
13
  9055477A1B50D3BD003A766C /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 905547791B50D3BD003A766C /* ViewController.swift */; };
13
14
  9055477D1B50D3BD003A766C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9055477B1B50D3BD003A766C /* Main.storyboard */; };
@@ -19,7 +20,6 @@
19
20
  905547BD1B50D4F1003A766C /* sample.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 905547BC1B50D4F1003A766C /* sample.bundle */; };
20
21
  905547BF1B50D506003A766C /* Multilingual.swift in Sources */ = {isa = PBXBuildFile; fileRef = 905547BE1B50D506003A766C /* Multilingual.swift */; };
21
22
  905547C11B50E379003A766C /* Sampler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 905547C01B50E379003A766C /* Sampler.swift */; };
22
- 9064D25A1B52323100950892 /* sample2.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 9064D2591B52323100950892 /* sample2.bundle */; };
23
23
  /* End PBXBuildFile section */
24
24
 
25
25
  /* Begin PBXContainerItemProxy section */
@@ -35,6 +35,7 @@
35
35
  /* Begin PBXFileReference section */
36
36
  0F051654B3882493E74104A2 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
37
37
  296E088C215EBFAA6DFD16F8 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; };
38
+ 901F30E81B63C0550049FC83 /* sample2.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = sample2.bundle; sourceTree = "<group>"; };
38
39
  905547721B50D3BD003A766C /* DemoApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DemoApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
39
40
  905547761B50D3BD003A766C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
40
41
  905547771B50D3BD003A766C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@@ -54,7 +55,6 @@
54
55
  905547BC1B50D4F1003A766C /* sample.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = sample.bundle; sourceTree = "<group>"; };
55
56
  905547BE1B50D506003A766C /* Multilingual.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Multilingual.swift; sourceTree = "<group>"; };
56
57
  905547C01B50E379003A766C /* Sampler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Sampler.swift; sourceTree = "<group>"; };
57
- 9064D2591B52323100950892 /* sample2.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = sample2.bundle; sourceTree = "<group>"; };
58
58
  9064D25B1B52352200950892 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; };
59
59
  9064D25C1B52352200950892 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Animal.strings; sourceTree = "<group>"; };
60
60
  C87EED93E62B990D188B64CA /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
@@ -96,6 +96,14 @@
96
96
  name = Pods;
97
97
  sourceTree = "<group>";
98
98
  };
99
+ 901F30E71B63C0550049FC83 /* Localizations */ = {
100
+ isa = PBXGroup;
101
+ children = (
102
+ 901F30E81B63C0550049FC83 /* sample2.bundle */,
103
+ );
104
+ path = Localizations;
105
+ sourceTree = "<group>";
106
+ };
99
107
  905547691B50D3BC003A766C = {
100
108
  isa = PBXGroup;
101
109
  children = (
@@ -119,8 +127,8 @@
119
127
  905547741B50D3BD003A766C /* DemoApp */ = {
120
128
  isa = PBXGroup;
121
129
  children = (
130
+ 901F30E71B63C0550049FC83 /* Localizations */,
122
131
  905547771B50D3BD003A766C /* AppDelegate.swift */,
123
- 9064D2581B52323100950892 /* Loalizations */,
124
132
  905547BC1B50D4F1003A766C /* sample.bundle */,
125
133
  905547C01B50E379003A766C /* Sampler.swift */,
126
134
  905547BE1B50D506003A766C /* Multilingual.swift */,
@@ -160,14 +168,6 @@
160
168
  name = "Supporting Files";
161
169
  sourceTree = "<group>";
162
170
  };
163
- 9064D2581B52323100950892 /* Loalizations */ = {
164
- isa = PBXGroup;
165
- children = (
166
- 9064D2591B52323100950892 /* sample2.bundle */,
167
- );
168
- path = Loalizations;
169
- sourceTree = "<group>";
170
- };
171
171
  /* End PBXGroup section */
172
172
 
173
173
  /* Begin PBXNativeTarget section */
@@ -256,7 +256,7 @@
256
256
  files = (
257
257
  9055477D1B50D3BD003A766C /* Main.storyboard in Resources */,
258
258
  905547BD1B50D4F1003A766C /* sample.bundle in Resources */,
259
- 9064D25A1B52323100950892 /* sample2.bundle in Resources */,
259
+ 901F30E91B63C0550049FC83 /* sample2.bundle in Resources */,
260
260
  905547B61B50D4BC003A766C /* Localizable.strings in Resources */,
261
261
  905547821B50D3BD003A766C /* LaunchScreen.xib in Resources */,
262
262
  9055477F1B50D3BD003A766C /* Images.xcassets in Resources */,
@@ -0,0 +1,89 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Scheme
3
+ LastUpgradeVersion = "0640"
4
+ version = "1.3">
5
+ <BuildAction
6
+ parallelizeBuildables = "YES"
7
+ buildImplicitDependencies = "YES">
8
+ <BuildActionEntries>
9
+ <BuildActionEntry
10
+ buildForTesting = "YES"
11
+ buildForRunning = "YES"
12
+ buildForProfiling = "YES"
13
+ buildForArchiving = "YES"
14
+ buildForAnalyzing = "YES">
15
+ <BuildableReference
16
+ BuildableIdentifier = "primary"
17
+ BlueprintIdentifier = "905547711B50D3BD003A766C"
18
+ BuildableName = "DemoApp.app"
19
+ BlueprintName = "DemoApp"
20
+ ReferencedContainer = "container:DemoApp.xcodeproj">
21
+ </BuildableReference>
22
+ </BuildActionEntry>
23
+ </BuildActionEntries>
24
+ </BuildAction>
25
+ <TestAction
26
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
27
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
28
+ shouldUseLaunchSchemeArgsEnv = "YES"
29
+ buildConfiguration = "Debug">
30
+ <Testables>
31
+ </Testables>
32
+ <MacroExpansion>
33
+ <BuildableReference
34
+ BuildableIdentifier = "primary"
35
+ BlueprintIdentifier = "905547711B50D3BD003A766C"
36
+ BuildableName = "DemoApp.app"
37
+ BlueprintName = "DemoApp"
38
+ ReferencedContainer = "container:DemoApp.xcodeproj">
39
+ </BuildableReference>
40
+ </MacroExpansion>
41
+ </TestAction>
42
+ <LaunchAction
43
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
44
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
45
+ launchStyle = "0"
46
+ useCustomWorkingDirectory = "NO"
47
+ buildConfiguration = "Debug"
48
+ ignoresPersistentStateOnLaunch = "NO"
49
+ debugDocumentVersioning = "YES"
50
+ allowLocationSimulation = "YES"
51
+ language = "en">
52
+ <BuildableProductRunnable
53
+ runnableDebuggingMode = "0">
54
+ <BuildableReference
55
+ BuildableIdentifier = "primary"
56
+ BlueprintIdentifier = "905547711B50D3BD003A766C"
57
+ BuildableName = "DemoApp.app"
58
+ BlueprintName = "DemoApp"
59
+ ReferencedContainer = "container:DemoApp.xcodeproj">
60
+ </BuildableReference>
61
+ </BuildableProductRunnable>
62
+ <AdditionalOptions>
63
+ </AdditionalOptions>
64
+ </LaunchAction>
65
+ <ProfileAction
66
+ shouldUseLaunchSchemeArgsEnv = "YES"
67
+ savedToolIdentifier = ""
68
+ useCustomWorkingDirectory = "NO"
69
+ buildConfiguration = "Release"
70
+ debugDocumentVersioning = "YES">
71
+ <BuildableProductRunnable
72
+ runnableDebuggingMode = "0">
73
+ <BuildableReference
74
+ BuildableIdentifier = "primary"
75
+ BlueprintIdentifier = "905547711B50D3BD003A766C"
76
+ BuildableName = "DemoApp.app"
77
+ BlueprintName = "DemoApp"
78
+ ReferencedContainer = "container:DemoApp.xcodeproj">
79
+ </BuildableReference>
80
+ </BuildableProductRunnable>
81
+ </ProfileAction>
82
+ <AnalyzeAction
83
+ buildConfiguration = "Debug">
84
+ </AnalyzeAction>
85
+ <ArchiveAction
86
+ buildConfiguration = "Release"
87
+ revealArchiveInOrganizer = "YES">
88
+ </ArchiveAction>
89
+ </Scheme>
@@ -0,0 +1,89 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Scheme
3
+ LastUpgradeVersion = "0640"
4
+ version = "1.3">
5
+ <BuildAction
6
+ parallelizeBuildables = "YES"
7
+ buildImplicitDependencies = "YES">
8
+ <BuildActionEntries>
9
+ <BuildActionEntry
10
+ buildForTesting = "YES"
11
+ buildForRunning = "YES"
12
+ buildForProfiling = "YES"
13
+ buildForArchiving = "YES"
14
+ buildForAnalyzing = "YES">
15
+ <BuildableReference
16
+ BuildableIdentifier = "primary"
17
+ BlueprintIdentifier = "905547711B50D3BD003A766C"
18
+ BuildableName = "DemoApp.app"
19
+ BlueprintName = "DemoApp"
20
+ ReferencedContainer = "container:DemoApp.xcodeproj">
21
+ </BuildableReference>
22
+ </BuildActionEntry>
23
+ </BuildActionEntries>
24
+ </BuildAction>
25
+ <TestAction
26
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
27
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
28
+ shouldUseLaunchSchemeArgsEnv = "YES"
29
+ buildConfiguration = "Debug">
30
+ <Testables>
31
+ </Testables>
32
+ <MacroExpansion>
33
+ <BuildableReference
34
+ BuildableIdentifier = "primary"
35
+ BlueprintIdentifier = "905547711B50D3BD003A766C"
36
+ BuildableName = "DemoApp.app"
37
+ BlueprintName = "DemoApp"
38
+ ReferencedContainer = "container:DemoApp.xcodeproj">
39
+ </BuildableReference>
40
+ </MacroExpansion>
41
+ </TestAction>
42
+ <LaunchAction
43
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
44
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
45
+ launchStyle = "0"
46
+ useCustomWorkingDirectory = "NO"
47
+ buildConfiguration = "Debug"
48
+ ignoresPersistentStateOnLaunch = "NO"
49
+ debugDocumentVersioning = "YES"
50
+ allowLocationSimulation = "YES"
51
+ language = "fr">
52
+ <BuildableProductRunnable
53
+ runnableDebuggingMode = "0">
54
+ <BuildableReference
55
+ BuildableIdentifier = "primary"
56
+ BlueprintIdentifier = "905547711B50D3BD003A766C"
57
+ BuildableName = "DemoApp.app"
58
+ BlueprintName = "DemoApp"
59
+ ReferencedContainer = "container:DemoApp.xcodeproj">
60
+ </BuildableReference>
61
+ </BuildableProductRunnable>
62
+ <AdditionalOptions>
63
+ </AdditionalOptions>
64
+ </LaunchAction>
65
+ <ProfileAction
66
+ shouldUseLaunchSchemeArgsEnv = "YES"
67
+ savedToolIdentifier = ""
68
+ useCustomWorkingDirectory = "NO"
69
+ buildConfiguration = "Release"
70
+ debugDocumentVersioning = "YES">
71
+ <BuildableProductRunnable
72
+ runnableDebuggingMode = "0">
73
+ <BuildableReference
74
+ BuildableIdentifier = "primary"
75
+ BlueprintIdentifier = "905547711B50D3BD003A766C"
76
+ BuildableName = "DemoApp.app"
77
+ BlueprintName = "DemoApp"
78
+ ReferencedContainer = "container:DemoApp.xcodeproj">
79
+ </BuildableReference>
80
+ </BuildableProductRunnable>
81
+ </ProfileAction>
82
+ <AnalyzeAction
83
+ buildConfiguration = "Debug">
84
+ </AnalyzeAction>
85
+ <ArchiveAction
86
+ buildConfiguration = "Release"
87
+ revealArchiveInOrganizer = "YES">
88
+ </ArchiveAction>
89
+ </Scheme>
@@ -0,0 +1,89 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Scheme
3
+ LastUpgradeVersion = "0640"
4
+ version = "1.3">
5
+ <BuildAction
6
+ parallelizeBuildables = "YES"
7
+ buildImplicitDependencies = "YES">
8
+ <BuildActionEntries>
9
+ <BuildActionEntry
10
+ buildForTesting = "YES"
11
+ buildForRunning = "YES"
12
+ buildForProfiling = "YES"
13
+ buildForArchiving = "YES"
14
+ buildForAnalyzing = "YES">
15
+ <BuildableReference
16
+ BuildableIdentifier = "primary"
17
+ BlueprintIdentifier = "905547711B50D3BD003A766C"
18
+ BuildableName = "DemoApp.app"
19
+ BlueprintName = "DemoApp"
20
+ ReferencedContainer = "container:DemoApp.xcodeproj">
21
+ </BuildableReference>
22
+ </BuildActionEntry>
23
+ </BuildActionEntries>
24
+ </BuildAction>
25
+ <TestAction
26
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
27
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
28
+ shouldUseLaunchSchemeArgsEnv = "YES"
29
+ buildConfiguration = "Debug">
30
+ <Testables>
31
+ </Testables>
32
+ <MacroExpansion>
33
+ <BuildableReference
34
+ BuildableIdentifier = "primary"
35
+ BlueprintIdentifier = "905547711B50D3BD003A766C"
36
+ BuildableName = "DemoApp.app"
37
+ BlueprintName = "DemoApp"
38
+ ReferencedContainer = "container:DemoApp.xcodeproj">
39
+ </BuildableReference>
40
+ </MacroExpansion>
41
+ </TestAction>
42
+ <LaunchAction
43
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
44
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
45
+ launchStyle = "0"
46
+ useCustomWorkingDirectory = "NO"
47
+ buildConfiguration = "Debug"
48
+ ignoresPersistentStateOnLaunch = "NO"
49
+ debugDocumentVersioning = "YES"
50
+ allowLocationSimulation = "YES"
51
+ language = "ja">
52
+ <BuildableProductRunnable
53
+ runnableDebuggingMode = "0">
54
+ <BuildableReference
55
+ BuildableIdentifier = "primary"
56
+ BlueprintIdentifier = "905547711B50D3BD003A766C"
57
+ BuildableName = "DemoApp.app"
58
+ BlueprintName = "DemoApp"
59
+ ReferencedContainer = "container:DemoApp.xcodeproj">
60
+ </BuildableReference>
61
+ </BuildableProductRunnable>
62
+ <AdditionalOptions>
63
+ </AdditionalOptions>
64
+ </LaunchAction>
65
+ <ProfileAction
66
+ shouldUseLaunchSchemeArgsEnv = "YES"
67
+ savedToolIdentifier = ""
68
+ useCustomWorkingDirectory = "NO"
69
+ buildConfiguration = "Release"
70
+ debugDocumentVersioning = "YES">
71
+ <BuildableProductRunnable
72
+ runnableDebuggingMode = "0">
73
+ <BuildableReference
74
+ BuildableIdentifier = "primary"
75
+ BlueprintIdentifier = "905547711B50D3BD003A766C"
76
+ BuildableName = "DemoApp.app"
77
+ BlueprintName = "DemoApp"
78
+ ReferencedContainer = "container:DemoApp.xcodeproj">
79
+ </BuildableReference>
80
+ </BuildableProductRunnable>
81
+ </ProfileAction>
82
+ <AnalyzeAction
83
+ buildConfiguration = "Debug">
84
+ </AnalyzeAction>
85
+ <ArchiveAction
86
+ buildConfiguration = "Release"
87
+ revealArchiveInOrganizer = "YES">
88
+ </ArchiveAction>
89
+ </Scheme>
@@ -0,0 +1,112 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Scheme
3
+ LastUpgradeVersion = "0640"
4
+ version = "1.3">
5
+ <BuildAction
6
+ parallelizeBuildables = "YES"
7
+ buildImplicitDependencies = "YES">
8
+ <BuildActionEntries>
9
+ <BuildActionEntry
10
+ buildForTesting = "YES"
11
+ buildForRunning = "YES"
12
+ buildForProfiling = "YES"
13
+ buildForArchiving = "YES"
14
+ buildForAnalyzing = "YES">
15
+ <BuildableReference
16
+ BuildableIdentifier = "primary"
17
+ BlueprintIdentifier = "905547711B50D3BD003A766C"
18
+ BuildableName = "DemoApp.app"
19
+ BlueprintName = "DemoApp"
20
+ ReferencedContainer = "container:DemoApp.xcodeproj">
21
+ </BuildableReference>
22
+ </BuildActionEntry>
23
+ <BuildActionEntry
24
+ buildForTesting = "YES"
25
+ buildForRunning = "YES"
26
+ buildForProfiling = "NO"
27
+ buildForArchiving = "NO"
28
+ buildForAnalyzing = "YES">
29
+ <BuildableReference
30
+ BuildableIdentifier = "primary"
31
+ BlueprintIdentifier = "905547861B50D3BD003A766C"
32
+ BuildableName = "DemoAppTests.xctest"
33
+ BlueprintName = "DemoAppTests"
34
+ ReferencedContainer = "container:DemoApp.xcodeproj">
35
+ </BuildableReference>
36
+ </BuildActionEntry>
37
+ </BuildActionEntries>
38
+ </BuildAction>
39
+ <TestAction
40
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
41
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
42
+ shouldUseLaunchSchemeArgsEnv = "YES"
43
+ buildConfiguration = "Debug">
44
+ <Testables>
45
+ <TestableReference
46
+ skipped = "NO">
47
+ <BuildableReference
48
+ BuildableIdentifier = "primary"
49
+ BlueprintIdentifier = "905547861B50D3BD003A766C"
50
+ BuildableName = "DemoAppTests.xctest"
51
+ BlueprintName = "DemoAppTests"
52
+ ReferencedContainer = "container:DemoApp.xcodeproj">
53
+ </BuildableReference>
54
+ </TestableReference>
55
+ </Testables>
56
+ <MacroExpansion>
57
+ <BuildableReference
58
+ BuildableIdentifier = "primary"
59
+ BlueprintIdentifier = "905547711B50D3BD003A766C"
60
+ BuildableName = "DemoApp.app"
61
+ BlueprintName = "DemoApp"
62
+ ReferencedContainer = "container:DemoApp.xcodeproj">
63
+ </BuildableReference>
64
+ </MacroExpansion>
65
+ </TestAction>
66
+ <LaunchAction
67
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
68
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
69
+ launchStyle = "0"
70
+ useCustomWorkingDirectory = "NO"
71
+ buildConfiguration = "Debug"
72
+ ignoresPersistentStateOnLaunch = "NO"
73
+ debugDocumentVersioning = "YES"
74
+ allowLocationSimulation = "YES">
75
+ <BuildableProductRunnable
76
+ runnableDebuggingMode = "0">
77
+ <BuildableReference
78
+ BuildableIdentifier = "primary"
79
+ BlueprintIdentifier = "905547711B50D3BD003A766C"
80
+ BuildableName = "DemoApp.app"
81
+ BlueprintName = "DemoApp"
82
+ ReferencedContainer = "container:DemoApp.xcodeproj">
83
+ </BuildableReference>
84
+ </BuildableProductRunnable>
85
+ <AdditionalOptions>
86
+ </AdditionalOptions>
87
+ </LaunchAction>
88
+ <ProfileAction
89
+ shouldUseLaunchSchemeArgsEnv = "YES"
90
+ savedToolIdentifier = ""
91
+ useCustomWorkingDirectory = "NO"
92
+ buildConfiguration = "Release"
93
+ debugDocumentVersioning = "YES">
94
+ <BuildableProductRunnable
95
+ runnableDebuggingMode = "0">
96
+ <BuildableReference
97
+ BuildableIdentifier = "primary"
98
+ BlueprintIdentifier = "905547711B50D3BD003A766C"
99
+ BuildableName = "DemoApp.app"
100
+ BlueprintName = "DemoApp"
101
+ ReferencedContainer = "container:DemoApp.xcodeproj">
102
+ </BuildableReference>
103
+ </BuildableProductRunnable>
104
+ </ProfileAction>
105
+ <AnalyzeAction
106
+ buildConfiguration = "Debug">
107
+ </AnalyzeAction>
108
+ <ArchiveAction
109
+ buildConfiguration = "Release"
110
+ revealArchiveInOrganizer = "YES">
111
+ </ArchiveAction>
112
+ </Scheme>
@@ -9,6 +9,9 @@
9
9
  import Foundation
10
10
 
11
11
  struct Multilingual {
12
+
13
+ class ClassForBundle {}
14
+
12
15
  enum Animal: String {
13
16
  case CAT = "CAT"
14
17
  case DOG = "DOG"
@@ -25,7 +28,7 @@ struct Multilingual {
25
28
  case MONKEY = "MONKEY"
26
29
 
27
30
  var value: String {
28
- return NSLocalizedString(rawValue, tableName: Animal.name, bundle: NSBundle.mainBundle(), value: rawValue, comment: "")
31
+ return NSLocalizedString(rawValue, tableName: Animal.name, bundle: Multilingual.bundle(nil), value: rawValue, comment: "")
29
32
  }
30
33
 
31
34
  static let name = "Animal"
@@ -45,7 +48,7 @@ struct Multilingual {
45
48
  case GOODEVENING = "GOODEVENING"
46
49
 
47
50
  var value: String {
48
- return NSLocalizedString(rawValue, tableName: Localizable.name, bundle: NSBundle.mainBundle(), value: rawValue, comment: "")
51
+ return NSLocalizedString(rawValue, tableName: Localizable.name, bundle: Multilingual.bundle(nil), value: rawValue, comment: "")
49
52
  }
50
53
 
51
54
  static let name = "Localizable"
@@ -63,7 +66,7 @@ struct Multilingual {
63
66
  case SAMPLE_2 = "SAMPLE 2"
64
67
 
65
68
  var value: String {
66
- return NSLocalizedString(rawValue, tableName: Sample2Sample_Localization.name, bundle: Multilingual.bundle("Loalizations/sample2.bundle"), value: rawValue, comment: "")
69
+ return NSLocalizedString(rawValue, tableName: Sample2Sample_Localization.name, bundle: Multilingual.bundle("sample2.bundle"), value: rawValue, comment: "")
67
70
  }
68
71
 
69
72
  static let name = "Sample Localization"
@@ -95,11 +98,15 @@ struct Multilingual {
95
98
  }
96
99
  }
97
100
 
101
+ }
102
+
103
+ extension Multilingual {
104
+ private static func bundle(bundleFile: String?) -> NSBundle {
105
+ if let bundleFile = bundleFile {
106
+ let path = NSBundle(forClass: Multilingual.ClassForBundle.self).resourcePath!.stringByAppendingPathComponent(bundleFile)
107
+ return NSBundle(path: path)!
108
+ }
98
109
 
99
- private static func bundle(relativePath: String) -> NSBundle {
100
- var components = (__FILE__ as String).pathComponents
101
- components.removeLast()
102
- let bundlePath = join("/", components) + "/" + relativePath
103
- return NSBundle(path: bundlePath) ?? NSBundle.mainBundle()
110
+ return NSBundle(forClass: ClassForBundle.self)
104
111
  }
105
112
  }
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+
3
+ bundle exec ../exe/xcmultilingual update DemoApp/Multilingual.swift --verbose
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- xcmultilingual (0.3.0)
4
+ xcmultilingual (0.3.1)
5
5
  thor
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -8,6 +8,14 @@ RubyGems: [xcmultilingual](https://rubygems.org/gems/xcmultilingual)
8
8
 
9
9
  ![GIF](misc/xcmultilingual.gif)
10
10
 
11
+ ## CANGELOG
12
+
13
+ See [CANGELOG](CHANGELOG.md) for update information.
14
+
15
+ ### Recent breaking changes
16
+
17
+ - **0.3.0** Getting localized value now from `value` computed property. It was `string()` function.
18
+
11
19
  ## Installation
12
20
 
13
21
  Add this line to your application's Gemfile:
@@ -59,6 +67,9 @@ Example:
59
67
  import Foundation
60
68
 
61
69
  struct Multilingual {
70
+
71
+ class ClassForBundle {}
72
+
62
73
  enum Animal: String {
63
74
  case CAT = "CAT"
64
75
  case DOG = "DOG"
@@ -75,7 +86,7 @@ struct Multilingual {
75
86
  case MONKEY = "MONKEY"
76
87
 
77
88
  var value: String {
78
- return NSLocalizedString(rawValue, tableName: Animal.name, bundle: NSBundle.mainBundle(), value: rawValue, comment: "")
89
+ return NSLocalizedString(rawValue, tableName: Animal.name, bundle: NSBundle(forClass: ClassForBundle.self), value: rawValue, comment: "")
79
90
  }
80
91
 
81
92
  static let name = "Animal"
@@ -95,7 +106,7 @@ struct Multilingual {
95
106
  case GOODEVENING = "GOODEVENING"
96
107
 
97
108
  var value: String {
98
- return NSLocalizedString(rawValue, tableName: Localizable.name, bundle: NSBundle.mainBundle(), value: rawValue, comment: "")
109
+ return NSLocalizedString(rawValue, tableName: Localizable.name, bundle: NSBundle(forClass: ClassForBundle.self), value: rawValue, comment: "")
99
110
  }
100
111
 
101
112
  static let name = "Localizable"
@@ -113,7 +124,7 @@ struct Multilingual {
113
124
  case SAMPLE = "SAMPLE"
114
125
 
115
126
  var value: String {
116
- return NSLocalizedString(rawValue, tableName: SampleSample.name, bundle: Multilingual.bundle("sample.bundle"), value: rawValue, comment: "")
127
+ return NSLocalizedString(rawValue, tableName: SampleSample.name, bundle: NSBundle(path: NSBundle(forClass: Multilingual.ClassForBundle.self).resourcePath!.stringByAppendingPathComponent("sample.bundle"))!, value: rawValue, comment: "")
117
128
  }
118
129
 
119
130
  static let name = "Sample"
@@ -127,13 +138,6 @@ struct Multilingual {
127
138
  }
128
139
  }
129
140
 
130
-
131
- private static func bundle(relativePath: String) -> NSBundle {
132
- var components = (__FILE__ as String).pathComponents
133
- components.removeLast()
134
- let bundlePath = join("/", components) + "/" + relativePath
135
- return NSBundle(path: bundlePath) ?? NSBundle.mainBundle()
136
- }
137
141
  }
138
142
  ```
139
143
 
@@ -1,10 +1,9 @@
1
1
  module Xcmultilingual
2
- Bundle = Struct.new("Bundle", :relative_path, :name, :tables) do
2
+ Bundle = Struct.new("Bundle", :name, :tables) do
3
3
  def description
4
- name_description = name.nil? ? "MAIN BUNDLE" : name
5
- relative_path_description = relative_path.nil? ? "NO RELATIVE PATH" : relative_path
4
+ name_description = name.nil? ? "PROJECT BUNDLE" : name
6
5
  tables_description = tables.map { |table| table.description }.join(" / ")
7
- "[#{name_description}]\nname: #{name_description}, relative_path: #{relative_path_description}, tables: #{tables_description}"
6
+ "[#{name_description}]\nname: #{name_description}, tables: #{tables_description}"
8
7
  end
9
8
  end
10
9
 
@@ -20,13 +20,15 @@ module Xcmultilingual
20
20
  writer.verbose = options[:verbose] || false
21
21
  writer.write
22
22
 
23
- puts "" if options[:verbose]
24
- puts "+++ DONE ++++++++++++++++++++++++" if options[:verbose]
25
- puts "" if options[:verbose]
26
- puts " See #{destination}" if options[:verbose]
27
- puts "" if options[:verbose]
28
- puts "+++++++++++++++++++++++++++++++++" if options[:verbose]
29
- puts "" if options[:verbose]
23
+ puts ""
24
+ puts "Generation finished."
25
+ puts ""
26
+ puts "+++++++++++++++++++++++++++++++++"
27
+ puts ""
28
+ puts "See #{destination}"
29
+ puts ""
30
+ puts "+++++++++++++++++++++++++++++++++"
31
+ puts ""
30
32
  end
31
33
 
32
34
  map %w[--version -v] => :__print_version
@@ -21,15 +21,11 @@ module Xcmultilingual
21
21
  # bundle
22
22
  if match = file_path.match(/(?<dir>(?<name>[^\/]*).bundle)/)
23
23
  bundle_name = match["name"]
24
- relative_path = file_path[0, match.end("dir")]
25
-
26
- relative_path = create_relative_path(destination_path, relative_path)
27
24
  else
28
25
  bundle_name = nil
29
- relative_path = nil
30
26
  end
31
27
 
32
- bundles[bundle_name] = {:relative_path => relative_path, :name => bundle_name, :tables => {}} unless bundles[bundle_name]
28
+ bundles[bundle_name] = {:name => bundle_name, :tables => {}} unless bundles[bundle_name]
33
29
 
34
30
  # name
35
31
  name = File.basename(file_path, ".strings")
@@ -47,7 +43,7 @@ module Xcmultilingual
47
43
 
48
44
  bundle_data = []
49
45
  bundles.each do |k, v|
50
- bundle = Bundle.new(v[:relative_path], v[:name], [])
46
+ bundle = Bundle.new(v[:name], [])
51
47
  v[:tables].each do |o, p|
52
48
  table = Table.new(o, p.to_a)
53
49
  bundle.tables << table
@@ -65,30 +61,6 @@ module Xcmultilingual
65
61
 
66
62
  private
67
63
 
68
- def create_relative_path(dest_path, src_path)
69
- dest_split = dest_path.split("/")
70
- src_split = src_path.split("/")
71
-
72
- src_extras = []
73
- src_split.each_with_index do |val, idx|
74
- next if val == dest_split[idx]
75
- src_extras << val
76
- end
77
-
78
- dest_extras = []
79
- dest_split.each_with_index do |val, idx|
80
- next if val == src_split[idx]
81
- dest_extras << val
82
- end
83
-
84
- prefix = ""
85
- (dest_extras.size - 1).times do |idx|
86
- prefix += "../"
87
- end
88
-
89
- prefix + src_extras.join("/")
90
- end
91
-
92
64
  def find_key(line)
93
65
  if match = line.match(/^\"(.*)\"\s*=\s*\"(.*)\"\;$/)
94
66
  return match[1]
@@ -9,18 +9,20 @@
9
9
  import Foundation
10
10
 
11
11
  struct <%= @name %> {
12
+ <% class_for_bundle = "ClassForBundle" %>
13
+ class <%= class_for_bundle %> {}
14
+
12
15
  <% @bundle_data.each do |bundle| -%>
13
- <% nsbundle = bundle.name ? "Multilingual.bundle(\"#{bundle.relative_path}\")" : "NSBundle.mainBundle()" -%>
14
- <% bundle_name = bundle.name.nil? ? "" : bundle.name.safe.capitalize -%>
16
+ <% enum_prefix = bundle.name.nil? ? "" : bundle.name.safe.capitalize -%>
15
17
  <% bundle.tables.each do |table| -%>
16
- <% class_name = bundle_name + table.name.safe -%>
17
- enum <%= class_name %>: String {
18
+ <% enum_name = enum_prefix + table.name.safe -%>
19
+ enum <%= enum_name %>: String {
18
20
  <% table.keys.each do |key| -%>
19
21
  case <%= key.safe %> = "<%= key %>"
20
22
  <% end # keys -%>
21
23
 
22
24
  var value: String {
23
- return NSLocalizedString(rawValue, tableName: <%= class_name %>.name, bundle: <%= nsbundle %>, value: rawValue, comment: "")
25
+ return NSLocalizedString(rawValue, tableName: <%= enum_name %>.name, bundle: <%= @name %>.bundle(<%= bundle.name.nil? ? "nil" : "\"#{bundle.name}.bundle\"" %>), value: rawValue, comment: "")
24
26
  }
25
27
 
26
28
  static let name = "<%= table.name %>"
@@ -30,17 +32,21 @@ struct <%= @name %> {
30
32
  }
31
33
 
32
34
  static var localizations: [String] {
33
- return <%= class_name %>.keys.map { <%= class_name %>(rawValue: $0)!.value }
35
+ return <%= enum_name %>.keys.map { <%= enum_name %>(rawValue: $0)!.value }
34
36
  }
35
37
  }
36
38
 
37
39
  <%- end # table -%>
38
40
  <%- end # bundle -%>
41
+ }
42
+
43
+ extension <%= @name %> {
44
+ private static func bundle(bundleFile: String?) -> NSBundle {
45
+ if let bundleFile = bundleFile {
46
+ let path = NSBundle(forClass: <%= @name %>.ClassForBundle.self).resourcePath!.stringByAppendingPathComponent(bundleFile)
47
+ return NSBundle(path: path)!
48
+ }
39
49
 
40
- private static func bundle(relativePath: String) -> NSBundle {
41
- var components = (__FILE__ as String).pathComponents
42
- components.removeLast()
43
- let bundlePath = join("/", components) + "/" + relativePath
44
- return NSBundle(path: bundlePath) ?? NSBundle.mainBundle()
50
+ return NSBundle(forClass: ClassForBundle.self)
45
51
  }
46
52
  }
@@ -1,3 +1,3 @@
1
1
  module Xcmultilingual
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcmultilingual
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naoki Morita
@@ -83,6 +83,10 @@ files:
83
83
  - DemoApp/.gitignore
84
84
  - DemoApp/DemoApp.xcodeproj/project.pbxproj
85
85
  - DemoApp/DemoApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata
86
+ - DemoApp/DemoApp.xcodeproj/xcshareddata/xcschemes/DemoApp-en.xcscheme
87
+ - DemoApp/DemoApp.xcodeproj/xcshareddata/xcschemes/DemoApp-fr.xcscheme
88
+ - DemoApp/DemoApp.xcodeproj/xcshareddata/xcschemes/DemoApp-jp.xcscheme
89
+ - DemoApp/DemoApp.xcodeproj/xcshareddata/xcschemes/DemoApp.xcscheme
86
90
  - DemoApp/DemoApp.xcworkspace/contents.xcworkspacedata
87
91
  - DemoApp/DemoApp/AppDelegate.swift
88
92
  - DemoApp/DemoApp/Base.lproj/Animal.strings
@@ -91,9 +95,9 @@ files:
91
95
  - DemoApp/DemoApp/Base.lproj/Main.storyboard
92
96
  - DemoApp/DemoApp/Images.xcassets/AppIcon.appiconset/Contents.json
93
97
  - DemoApp/DemoApp/Info.plist
94
- - DemoApp/DemoApp/Loalizations/sample2.bundle/Base.lproj/Sample Localization.strings
95
- - DemoApp/DemoApp/Loalizations/sample2.bundle/en.lproj/Sample Localization.strings
96
- - DemoApp/DemoApp/Loalizations/sample2.bundle/ja.lproj/Sample Localization.strings
98
+ - DemoApp/DemoApp/Localizations/sample2.bundle/Base.lproj/Sample Localization.strings
99
+ - DemoApp/DemoApp/Localizations/sample2.bundle/en.lproj/Sample Localization.strings
100
+ - DemoApp/DemoApp/Localizations/sample2.bundle/ja.lproj/Sample Localization.strings
97
101
  - DemoApp/DemoApp/Multilingual.swift
98
102
  - DemoApp/DemoApp/Sampler.swift
99
103
  - DemoApp/DemoApp/ViewController.swift
@@ -134,6 +138,7 @@ files:
134
138
  - DemoApp/Pods/Target Support Files/Pods/Pods.modulemap
135
139
  - DemoApp/Pods/Target Support Files/Pods/Pods.release.xcconfig
136
140
  - DemoApp/custom_template.erb
141
+ - DemoApp/script/xcmultilingual
137
142
  - Gemfile
138
143
  - Gemfile.lock
139
144
  - LICENSE