Skip to content

Instantly share code, notes, and snippets.

@dimitribouniol
Last active May 14, 2024 09:25
Show Gist options
  • Save dimitribouniol/dd40c07453354c77ca20cfb208dcff1f to your computer and use it in GitHub Desktop.
Save dimitribouniol/dd40c07453354c77ca20cfb208dcff1f to your computer and use it in GitHub Desktop.
.xcstrings: Codable
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