Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
LocalizationKey enum with parameters
enum LocalizationKey {
case hello
case bye(String)
case progress(Int, Int)
var string: String {
switch self {
case .hello:
return "hello".localized()
case .bye(let name):
return String(format: "bye".localized(), name)
case .progress(let from, let to):
return String(format: "progress".localized(), from, to)
}
}
}
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.