Skip to content

Commit 1517ed8

Browse files
committed
Treat string literals as localization keys unless verbatim is used.
1 parent 58a28c5 commit 1517ed8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Sources/Icons/Icon.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,13 @@ public extension Label where Title == Text, Icon == Image {
5050
self.init(titleKey, systemImage: key.systemImage)
5151
}
5252

53-
init(_ title: String, icon key: IconKey) {
53+
init(verbatim title: String, icon key: IconKey) {
5454
self.init(title, systemImage: key.systemImage)
5555
}
56+
57+
init(_ title: StringLiteralType, icon key: IconKey) {
58+
self.init(LocalizedStringResource(stringLiteral: title), icon: key)
59+
}
5660
}
5761

5862
public extension LabeledContent where Label == SwiftUI.Label<Text, Image>, Content: View {

0 commit comments

Comments
 (0)