@@ -32,38 +32,21 @@ extension StringsFileParser {
3232 public func stencilContext( enumName: String = " L10n " , tableName: String = " Localizable " ) -> [ String : Any ] {
3333
3434 let entryToStringMapper = { ( entry: Entry , keyPath: [ String ] ) -> [ String : Any ] in
35- var keyStructure = entry. keyStructure
36- Array ( 0 ..< keyPath. count) . forEach { _ in keyStructure. removeFirst ( ) }
37- let levelName = keyStructure. joined ( separator: " . " )
35+ let levelName = entry. keyStructure. last ?? " "
3836
3937 var result : [ String : Any ] = [
4038 " name " : levelName,
4139 " key " : entry. key. newlineEscaped,
42- " translation " : entry. translation. newlineEscaped,
43-
44- // NOTE: keytail is deprecated
45- " keytail " : levelName
40+ " translation " : entry. translation. newlineEscaped
4641 ]
4742
4843 if entry. types. count > 0 {
4944 result [ " types " ] = entry. types. map { $0. rawValue }
50-
51- // NOTE: params is deprecated
52- result [ " params " ] = [
53- " types " : entry. types. map { $0. rawValue } ,
54- " count " : entry. types. count,
55- " declarations " : entry. types. indices. map { " let p \( $0) " } ,
56- " names " : entry. types. indices. map { " p \( $0) " } ,
57- " typednames " : entry. types. enumerated ( ) . map { " p \( $0) : \( $1. rawValue) " }
58- ]
5945 }
6046
6147 return result
6248 }
6349
64- let strings = entries
65- . sorted { $0. key. caseInsensitiveCompare ( $1. key) == . orderedAscending }
66- . map { entryToStringMapper ( $0, [ ] ) }
6750 let structuredStrings = structure (
6851 entries: entries,
6952 usingMapper: entryToStringMapper
@@ -74,14 +57,7 @@ extension StringsFileParser {
7457 ] ]
7558
7659 return [
77- " tables " : tables,
78-
79- // NOTE: These are deprecated variables
80- " enumName " : enumName,
81- " param " : [ " enumName " : enumName] ,
82- " strings " : strings,
83- " structuredStrings " : structuredStrings,
84- " tableName " : tableName
60+ " tables " : tables
8561 ]
8662 }
8763
@@ -139,9 +115,6 @@ extension StringsFileParser {
139115
140116 if !children. isEmpty {
141117 structuredStrings [ " children " ] = children
142-
143- // NOTE: These are deprecated variables
144- structuredStrings [ " subenums " ] = children
145118 }
146119
147120 return structuredStrings
0 commit comments