Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Localization struct
struct Localization {
let string: String
private init(string: String) {
self.string = string
}
static func bye(name: String) -> Localization {
return Localization(string: String(format: LocalizationKey.bye.string, name))
}
static func hello() -> Localization {
return Localization(string: LocalizationKey.hello.string)
}
static func progress(from: Int, to: Int) -> Localization {
return Localization(string: String(format: LocalizationKey.progress.string, from, to), key: .progress)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.