Skip to content

Instantly share code, notes, and snippets.

@mukyasa
Last active May 7, 2020 17:55
Show Gist options
  • Save mukyasa/f4694db42f9ebb15f761413ddb1db537 to your computer and use it in GitHub Desktop.
Save mukyasa/f4694db42f9ebb15f761413ddb1db537 to your computer and use it in GitHub Desktop.
@propertyWrapper
struct Localizable {
var wrappedValue: String {
didSet { wrappedValue = NSLocalizedString(wrappedValue, comment: "") }
}
init(wrappedValue: String) {
self.wrappedValue = NSLocalizedString(wrappedValue, comment: "")
}
}
enum Strings {
@Localizable static var featureOneTitle = "featureOneTitle"
@Localizable static var featureTwoTitle = "featureTwoTitle"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment