Skip to content

Commit

Permalink
Use Text.init(verbatim:) to avoid localization warnings (#2541)
Browse files Browse the repository at this point in the history
Fixes #2502.
  • Loading branch information
stephencelis authored Nov 2, 2023
1 parent 9abf1e3 commit 87aeaf6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ extension Text {
}
flushSegment()

self = segments.reduce(Text(""), +)
self = segments.reduce(Text(verbatim: ""), +)
}
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/ComposableArchitecture/SwiftUI/Alert.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extension View {
) { `self`, $isPresented, destination in
let alertState = store.withState { $0.wrappedValue.flatMap(toDestinationState) }
self.alert(
(alertState?.title).map(Text.init) ?? Text(""),
(alertState?.title).map(Text.init) ?? Text(verbatim: ""),
isPresented: $isPresented,
presenting: alertState,
actions: { alertState in
Expand All @@ -55,7 +55,7 @@ extension View {
}
},
message: {
$0.message.map(Text.init) ?? Text("")
$0.message.map(Text.init)
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extension View {
) { `self`, $isPresented, destination in
let confirmationDialogState = store.withState { $0.wrappedValue.flatMap(toDestinationState) }
self.confirmationDialog(
(confirmationDialogState?.title).map(Text.init) ?? Text(""),
(confirmationDialogState?.title).map(Text.init) ?? Text(verbatim: ""),
isPresented: $isPresented,
titleVisibility: (confirmationDialogState?.titleVisibility).map(Visibility.init)
?? .automatic,
Expand Down

0 comments on commit 87aeaf6

Please sign in to comment.