Skip to content

Commit d3e010f

Browse files
author
Andrew Lloyd
committed
target membership fix for SKTranslation template file
1 parent c7a7642 commit d3e010f

File tree

3 files changed

+3
-239
lines changed

3 files changed

+3
-239
lines changed
Lines changed: 1 addition & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ----------------------------------------------------------------------
22
// File generated by NStack Translations Generator.
33
//
4-
// Copyright (c) 2018 Nodes ApS
4+
// Copyright (c) 2019 Nodes ApS
55
//
66
// Permission is hereby granted, free of charge, to any person obtaining
77
// a copy of this software and associated documentation files (the
@@ -24,121 +24,3 @@
2424
// ----------------------------------------------------------------------
2525

2626
import Foundation
27-
import TranslationManager
28-
29-
public final class SKTranslations: LocalizableModel {
30-
public var oneMoreSection = OneMoreSection()
31-
public var defaultSection = DefaultSection()
32-
public var otherSection = OtherSection()
33-
34-
enum CodingKeys: String, CodingKey {
35-
case oneMoreSection
36-
case defaultSection = "default"
37-
case otherSection
38-
}
39-
40-
public override init() { super.init() }
41-
42-
public required init(from decoder: Decoder) throws {
43-
super.init()
44-
let container = try decoder.container(keyedBy: CodingKeys.self)
45-
oneMoreSection = try container.decodeIfPresent(OneMoreSection.self, forKey: .oneMoreSection) ?? oneMoreSection
46-
defaultSection = try container.decodeIfPresent(DefaultSection.self, forKey: .defaultSection) ?? defaultSection
47-
otherSection = try container.decodeIfPresent(OtherSection.self, forKey: .otherSection) ?? otherSection
48-
}
49-
50-
public override subscript(key: String) -> LocalizableSection? {
51-
switch key {
52-
case CodingKeys.oneMoreSection.stringValue: return oneMoreSection
53-
case CodingKeys.defaultSection.stringValue: return defaultSection
54-
case CodingKeys.otherSection.stringValue: return otherSection
55-
default: return nil
56-
}
57-
}
58-
59-
public final class OneMoreSection: LocalizableSection {
60-
public var soManyKeys = ""
61-
public var test1 = ""
62-
public var test2 = ""
63-
64-
enum CodingKeys: String, CodingKey {
65-
case soManyKeys
66-
case test1
67-
case test2
68-
}
69-
70-
public override init() {
71-
super.init()
72-
soManyKeys = "\(classNameLowerCased()).soManyKeys"
73-
test1 = "\(classNameLowerCased()).test1"
74-
test2 = "\(classNameLowerCased()).test2"
75-
}
76-
77-
public required init(from decoder: Decoder) throws {
78-
super.init()
79-
let container = try decoder.container(keyedBy: CodingKeys.self)
80-
soManyKeys = try container.decodeIfPresent(String.self, forKey: .soManyKeys) ?? "__soManyKeys"
81-
test1 = try container.decodeIfPresent(String.self, forKey: .test1) ?? "__test1"
82-
test2 = try container.decodeIfPresent(String.self, forKey: .test2) ?? "__test2"
83-
}
84-
85-
public override subscript(key: String) -> String? {
86-
return ""
87-
}
88-
}
89-
90-
public final class DefaultSection: LocalizableSection {
91-
public var emptyKey = ""
92-
public var keyys = ""
93-
public var successKey = ""
94-
95-
enum CodingKeys: String, CodingKey {
96-
case emptyKey
97-
case keyys
98-
case successKey
99-
}
100-
101-
public override init() {
102-
super.init()
103-
emptyKey = "\(classNameLowerCased()).emptyKey"
104-
keyys = "\(classNameLowerCased()).keyys"
105-
successKey = "\(classNameLowerCased()).successKey"
106-
}
107-
108-
public required init(from decoder: Decoder) throws {
109-
super.init()
110-
let container = try decoder.container(keyedBy: CodingKeys.self)
111-
emptyKey = try container.decodeIfPresent(String.self, forKey: .emptyKey) ?? "__emptyKey"
112-
keyys = try container.decodeIfPresent(String.self, forKey: .keyys) ?? "__keyys"
113-
successKey = try container.decodeIfPresent(String.self, forKey: .successKey) ?? "__successKey"
114-
}
115-
116-
public override subscript(key: String) -> String? {
117-
return ""
118-
}
119-
}
120-
121-
public final class OtherSection: LocalizableSection {
122-
public var otherString = ""
123-
124-
enum CodingKeys: String, CodingKey {
125-
case otherString
126-
}
127-
128-
public override init() {
129-
super.init()
130-
otherString = "\(classNameLowerCased()).otherString"
131-
}
132-
133-
public required init(from decoder: Decoder) throws {
134-
super.init()
135-
let container = try decoder.container(keyedBy: CodingKeys.self)
136-
otherString = try container.decodeIfPresent(String.self, forKey: .otherString) ?? "__otherString"
137-
}
138-
139-
public override subscript(key: String) -> String? {
140-
return ""
141-
}
142-
}
143-
}
144-

TranslationsGeneratorTests/Translations.swift

Lines changed: 0 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -24,121 +24,3 @@
2424
// ----------------------------------------------------------------------
2525

2626
import Foundation
27-
import TranslationManager
28-
29-
public final class Translations: LocalizableModel {
30-
public var oneMoreSection = OneMoreSection()
31-
public var defaultSection = DefaultSection()
32-
public var otherSection = OtherSection()
33-
34-
enum CodingKeys: String, CodingKey {
35-
case oneMoreSection
36-
case defaultSection = "default"
37-
case otherSection
38-
}
39-
40-
public override init() { super.init() }
41-
42-
public required init(from decoder: Decoder) throws {
43-
super.init()
44-
let container = try decoder.container(keyedBy: CodingKeys.self)
45-
oneMoreSection = try container.decodeIfPresent(OneMoreSection.self, forKey: .oneMoreSection) ?? oneMoreSection
46-
defaultSection = try container.decodeIfPresent(DefaultSection.self, forKey: .defaultSection) ?? defaultSection
47-
otherSection = try container.decodeIfPresent(OtherSection.self, forKey: .otherSection) ?? otherSection
48-
}
49-
50-
public override subscript(key: String) -> LocalizableSection? {
51-
switch key {
52-
case CodingKeys.oneMoreSection.stringValue: return oneMoreSection
53-
case CodingKeys.defaultSection.stringValue: return defaultSection
54-
case CodingKeys.otherSection.stringValue: return otherSection
55-
default: return nil
56-
}
57-
}
58-
59-
public final class OneMoreSection: LocalizableSection {
60-
public var soManyKeys = ""
61-
public var test1 = ""
62-
public var test2 = ""
63-
64-
enum CodingKeys: String, CodingKey {
65-
case soManyKeys
66-
case test1
67-
case test2
68-
}
69-
70-
public override init() { super.init() }
71-
72-
public required init(from decoder: Decoder) throws {
73-
super.init()
74-
let container = try decoder.container(keyedBy: CodingKeys.self)
75-
soManyKeys = try container.decodeIfPresent(String.self, forKey: .soManyKeys) ?? "__soManyKeys"
76-
test1 = try container.decodeIfPresent(String.self, forKey: .test1) ?? "__test1"
77-
test2 = try container.decodeIfPresent(String.self, forKey: .test2) ?? "__test2"
78-
}
79-
80-
public override subscript(key: String) -> String? {
81-
switch key {
82-
case CodingKeys.soManyKeys.stringValue: return soManyKeys
83-
case CodingKeys.test1.stringValue: return test1
84-
case CodingKeys.test2.stringValue: return test2
85-
default: return nil
86-
}
87-
}
88-
}
89-
90-
public final class DefaultSection: LocalizableSection {
91-
public var emptyKey = ""
92-
public var keyys = ""
93-
public var successKey = ""
94-
95-
enum CodingKeys: String, CodingKey {
96-
case emptyKey
97-
case keyys
98-
case successKey
99-
}
100-
101-
public override init() { super.init() }
102-
103-
public required init(from decoder: Decoder) throws {
104-
super.init()
105-
let container = try decoder.container(keyedBy: CodingKeys.self)
106-
emptyKey = try container.decodeIfPresent(String.self, forKey: .emptyKey) ?? "__emptyKey"
107-
keyys = try container.decodeIfPresent(String.self, forKey: .keyys) ?? "__keyys"
108-
successKey = try container.decodeIfPresent(String.self, forKey: .successKey) ?? "__successKey"
109-
}
110-
111-
public override subscript(key: String) -> String? {
112-
switch key {
113-
case CodingKeys.emptyKey.stringValue: return emptyKey
114-
case CodingKeys.keyys.stringValue: return keyys
115-
case CodingKeys.successKey.stringValue: return successKey
116-
default: return nil
117-
}
118-
}
119-
}
120-
121-
public final class OtherSection: LocalizableSection {
122-
public var otherString = ""
123-
124-
enum CodingKeys: String, CodingKey {
125-
case otherString
126-
}
127-
128-
public override init() { super.init() }
129-
130-
public required init(from decoder: Decoder) throws {
131-
super.init()
132-
let container = try decoder.container(keyedBy: CodingKeys.self)
133-
otherString = try container.decodeIfPresent(String.self, forKey: .otherString) ?? "__otherString"
134-
}
135-
136-
public override subscript(key: String) -> String? {
137-
switch key {
138-
case CodingKeys.otherString.stringValue: return otherString
139-
default: return nil
140-
}
141-
}
142-
}
143-
}
144-

nstack-translations-generator.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
231C6CD022FB148600C1B26F /* Translations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 231C6CCE22FB148600C1B26F /* Translations.swift */; };
2121
231C6CD122FB148600C1B26F /* Translations_en-GB.json in Resources */ = {isa = PBXBuildFile; fileRef = 231C6CCF22FB148600C1B26F /* Translations_en-GB.json */; };
2222
2333A1DA230EB1A9003520B0 /* SKTranslations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2333A1D9230EB1A9003520B0 /* SKTranslations.swift */; };
23-
2333A1E4230FDBD1003520B0 /* SKTImplementationTemplate.txt in Resources */ = {isa = PBXBuildFile; fileRef = 2333A1E3230FDBD0003520B0 /* SKTImplementationTemplate.txt */; };
23+
2333A1E5230FEE87003520B0 /* SKTImplementationTemplate.txt in Resources */ = {isa = PBXBuildFile; fileRef = 2333A1E3230FDBD0003520B0 /* SKTImplementationTemplate.txt */; };
2424
23E79B3F230C57AD00CC2F60 /* Translations_da-DK.json in Resources */ = {isa = PBXBuildFile; fileRef = 23E79B3E230C57AD00CC2F60 /* Translations_da-DK.json */; };
2525
4BEB675802B887383D43E489 /* Pods_TranslationsGenerator.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6E542EC77F964BEA400B6BF8 /* Pods_TranslationsGenerator.framework */; };
2626
A95D3AA6B98CC1065FAA7AE9 /* Pods_TranslationsGeneratorTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5793EFD3A20502E2E0D0C7BF /* Pods_TranslationsGeneratorTests.framework */; };
@@ -472,6 +472,7 @@
472472
isa = PBXResourcesBuildPhase;
473473
buildActionMask = 2147483647;
474474
files = (
475+
2333A1E5230FEE87003520B0 /* SKTImplementationTemplate.txt in Resources */,
475476
01DA430D1C78976900D0FC04 /* ImplementationTemplate.txt in Resources */,
476477
B4715A73224842A30020F25B /* ImplementationTemplateStandalone.txt in Resources */,
477478
);
@@ -481,7 +482,6 @@
481482
isa = PBXResourcesBuildPhase;
482483
buildActionMask = 2147483647;
483484
files = (
484-
2333A1E4230FDBD1003520B0 /* SKTImplementationTemplate.txt in Resources */,
485485
231C6CD122FB148600C1B26F /* Translations_en-GB.json in Resources */,
486486
23E79B3F230C57AD00CC2F60 /* Translations_da-DK.json in Resources */,
487487
);

0 commit comments

Comments
 (0)