-
Notifications
You must be signed in to change notification settings - Fork 8
Strings: rename some vars for clarity purposes #33
Conversation
- strings --> levels - subenums --> children - keytail --> name
@@ -67,7 +70,7 @@ extension StringsFileParser { | |||
) | |||
let tables: [[String: Any]] = [[ | |||
"name": tableName, | |||
"strings": structuredStrings | |||
"levels": structuredStrings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we keep the strings
entry too (duplicate of levels
) for 4.2.1 until we can remove it in 5.0.0, at least f we want to merge that for 4.2.1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lemme check, but I don't think tables.strings
was ever released.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good point, maybe not ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jup, never released:
return [ |
(that's SwiftGenKit 1.0.1)
Sources/Stencil/StringsContext.swift
Outdated
- `name` : `String` — name of the `.strings` file (usually `"Localizable"`) | ||
- `levels`: `Array` — Tree structure of strings (based on dot syntax), each level has: | ||
- `name` : `String` — name of the level (that is, part of the key split by `.` that we're describing) | ||
- `children`: `Array` — list of sub-levels, repeating the structure mentioned above |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mentioned below?
Repeating the same structure as a level?
Sources/Stencil/StringsContext.swift
Outdated
@@ -37,8 +37,11 @@ extension StringsFileParser { | |||
let keytail = keyStructure.joined(separator: ".") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename the variable as well in the code for consistency?
Sources/Stencil/StringsContext.swift
Outdated
@@ -135,6 +138,9 @@ extension StringsFileParser { | |||
} | |||
|
|||
if !subenums.isEmpty { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename the variable in the code too for consistency
Implements #5
Related to SwiftGen/templates#43