Last active
October 15, 2018 08:16
-
-
Save damijanracel/57b95e89876b8f80b530c6e6e9e40004 to your computer and use it in GitHub Desktop.
Localization struct
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
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