This package contains macros used in the Pass project.
A freestanding expression macro that converts a static string literal into a localized string, with optional format arguments and bundle support.
#localized("Hello world")
// expands to:
String(localized: "Hello world")#localized("Hello %@", "world")
// expands to:
String(format: String(localized: "Hello %@"), "world")
#localized("Version %@ (%d)", "1.0.0", 5)
// expands to:
String(format: String(localized: "Version %@ (%d)"), "1.0.0", 5)#localized("Hello world", bundle: .module)
// expands to:
String(localized: "Hello world", bundle: .module)
#localized("Hello %@", bundle: .module, "world")
// expands to:
String(format: String(localized: "Hello %@", bundle: .module), "world")- Swift 6.0+
- macOS 12+, iOS 15+, tvOS 15+, watchOS 8+
Add this package as a dependency in your Package.swift:
.package(url: "<repo-url>", from: "<version>"),Then add "Macro" to your target's dependencies.