Last active
May 14, 2024 09:25
-
-
Save dimitribouniol/dd40c07453354c77ca20cfb208dcff1f to your computer and use it in GitHub Desktop.
.xcstrings: Codable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JSONDecoder().decode([String : Localizations].self from: ...) | |
struct Localizations: Codable { | |
var localizations: [String : Localization] | |
} | |
struct Localization: Codable { | |
var stringUnit: StringUnit | |
var substitutions: [String : Substitution] | |
} | |
struct StringUnit: Codabale { | |
enum State: String, Codable { | |
case translated | |
} | |
var state: State | |
var value: String | |
} | |
enum FormatSpecifier: String, Codable { | |
case lld | |
} | |
struct Substitution: Codable { | |
var formatSpecifier: FormatSpecifier | |
var variations: [Variation] | |
} | |
struct Variation: Codable { | |
struct Plural: Codable { | |
var one: Value | |
var other: Value | |
} | |
struct Value: Codable { | |
var stringUnit: StringUnit | |
} | |
var pural: Plural | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment