Skip to content

Instantly share code, notes, and snippets.

@damijanracel
Last active October 15, 2018 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save damijanracel/57b95e89876b8f80b530c6e6e9e40004 to your computer and use it in GitHub Desktop.
Save damijanracel/57b95e89876b8f80b530c6e6e9e40004 to your computer and use it in GitHub Desktop.
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