Skip to content

Commit 5eb5899

Browse files
authored
Use Text.init(verbatim:) to avoid localization warnings (pointfreeco#131)
1 parent 74adfb8 commit 5eb5899

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Sources/SwiftUINavigation/Alert.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
@ViewBuilder message: (Value) -> M
6262
) -> some View {
6363
self.alert(
64-
value.wrappedValue.map(title) ?? Text(""),
64+
value.wrappedValue.map(title) ?? Text(verbatim: ""),
6565
isPresented: value.isPresent(),
6666
presenting: value.wrappedValue,
6767
actions: actions,
@@ -122,7 +122,7 @@
122122
action handler: @escaping (Value?) -> Void = { (_: Never?) in }
123123
) -> some View {
124124
self.alert(
125-
(value.wrappedValue?.title).map(Text.init) ?? Text(""),
125+
(value.wrappedValue?.title).map(Text.init) ?? Text(verbatim: ""),
126126
isPresented: value.isPresent(),
127127
presenting: value.wrappedValue,
128128
actions: {
@@ -155,7 +155,7 @@
155155
action handler: @escaping (Value?) async -> Void = { (_: Never?) async in }
156156
) -> some View {
157157
self.alert(
158-
(value.wrappedValue?.title).map(Text.init) ?? Text(""),
158+
(value.wrappedValue?.title).map(Text.init) ?? Text(verbatim: ""),
159159
isPresented: value.isPresent(),
160160
presenting: value.wrappedValue,
161161
actions: {
@@ -228,7 +228,7 @@
228228
action handler: @escaping (Value?) -> Void
229229
) -> some View {
230230
self.alert(
231-
(value.wrappedValue?.title).map(Text.init) ?? Text(""),
231+
(value.wrappedValue?.title).map(Text.init) ?? Text(verbatim: ""),
232232
isPresented: value.isPresent(),
233233
presenting: value.wrappedValue,
234234
actions: {
@@ -246,7 +246,7 @@
246246
action handler: @escaping (Value?) async -> Void
247247
) -> some View {
248248
self.alert(
249-
(value.wrappedValue?.title).map(Text.init) ?? Text(""),
249+
(value.wrappedValue?.title).map(Text.init) ?? Text(verbatim: ""),
250250
isPresented: value.isPresent(),
251251
presenting: value.wrappedValue,
252252
actions: {
@@ -263,7 +263,7 @@
263263
unwrapping value: Binding<AlertState<Never>?>
264264
) -> some View {
265265
self.alert(
266-
(value.wrappedValue?.title).map(Text.init) ?? Text(""),
266+
(value.wrappedValue?.title).map(Text.init) ?? Text(verbatim: ""),
267267
isPresented: value.isPresent(),
268268
presenting: value.wrappedValue,
269269
actions: {

Sources/SwiftUINavigation/ConfirmationDialog.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
@ViewBuilder message: (Value) -> M
6767
) -> some View {
6868
self.confirmationDialog(
69-
value.wrappedValue.map(title) ?? Text(""),
69+
value.wrappedValue.map(title) ?? Text(verbatim: ""),
7070
isPresented: value.isPresent(),
7171
titleVisibility: titleVisibility,
7272
presenting: value.wrappedValue,
@@ -130,7 +130,7 @@
130130
action handler: @escaping (Value?) -> Void = { (_: Never?) in }
131131
) -> some View {
132132
self.confirmationDialog(
133-
value.wrappedValue.flatMap { Text($0.title) } ?? Text(""),
133+
value.wrappedValue.flatMap { Text($0.title) } ?? Text(verbatim: ""),
134134
isPresented: value.isPresent(),
135135
titleVisibility: value.wrappedValue.map { .init($0.titleVisibility) } ?? .automatic,
136136
presenting: value.wrappedValue,
@@ -164,7 +164,7 @@
164164
action handler: @escaping (Value?) async -> Void = { (_: Never?) async in }
165165
) -> some View {
166166
self.confirmationDialog(
167-
value.wrappedValue.flatMap { Text($0.title) } ?? Text(""),
167+
value.wrappedValue.flatMap { Text($0.title) } ?? Text(verbatim: ""),
168168
isPresented: value.isPresent(),
169169
titleVisibility: value.wrappedValue.map { .init($0.titleVisibility) } ?? .automatic,
170170
presenting: value.wrappedValue,
@@ -240,7 +240,7 @@
240240
action handler: @escaping (Value?) -> Void
241241
) -> some View {
242242
self.confirmationDialog(
243-
value.wrappedValue.flatMap { Text($0.title) } ?? Text(""),
243+
value.wrappedValue.flatMap { Text($0.title) } ?? Text(verbatim: ""),
244244
isPresented: value.isPresent(),
245245
titleVisibility: value.wrappedValue.map { .init($0.titleVisibility) } ?? .automatic,
246246
presenting: value.wrappedValue,
@@ -259,7 +259,7 @@
259259
action handler: @escaping (Value?) async -> Void
260260
) -> some View {
261261
self.confirmationDialog(
262-
value.wrappedValue.flatMap { Text($0.title) } ?? Text(""),
262+
value.wrappedValue.flatMap { Text($0.title) } ?? Text(verbatim: ""),
263263
isPresented: value.isPresent(),
264264
titleVisibility: value.wrappedValue.map { .init($0.titleVisibility) } ?? .automatic,
265265
presenting: value.wrappedValue,

0 commit comments

Comments
 (0)