Skip to content

Commit

Permalink
Use Text.init(verbatim:) to avoid localization warnings (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephencelis authored Nov 2, 2023
1 parent 74adfb8 commit 5eb5899
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions Sources/SwiftUINavigation/Alert.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
@ViewBuilder message: (Value) -> M
) -> some View {
self.alert(
value.wrappedValue.map(title) ?? Text(""),
value.wrappedValue.map(title) ?? Text(verbatim: ""),
isPresented: value.isPresent(),
presenting: value.wrappedValue,
actions: actions,
Expand Down Expand Up @@ -122,7 +122,7 @@
action handler: @escaping (Value?) -> Void = { (_: Never?) in }
) -> some View {
self.alert(
(value.wrappedValue?.title).map(Text.init) ?? Text(""),
(value.wrappedValue?.title).map(Text.init) ?? Text(verbatim: ""),
isPresented: value.isPresent(),
presenting: value.wrappedValue,
actions: {
Expand Down Expand Up @@ -155,7 +155,7 @@
action handler: @escaping (Value?) async -> Void = { (_: Never?) async in }
) -> some View {
self.alert(
(value.wrappedValue?.title).map(Text.init) ?? Text(""),
(value.wrappedValue?.title).map(Text.init) ?? Text(verbatim: ""),
isPresented: value.isPresent(),
presenting: value.wrappedValue,
actions: {
Expand Down Expand Up @@ -228,7 +228,7 @@
action handler: @escaping (Value?) -> Void
) -> some View {
self.alert(
(value.wrappedValue?.title).map(Text.init) ?? Text(""),
(value.wrappedValue?.title).map(Text.init) ?? Text(verbatim: ""),
isPresented: value.isPresent(),
presenting: value.wrappedValue,
actions: {
Expand All @@ -246,7 +246,7 @@
action handler: @escaping (Value?) async -> Void
) -> some View {
self.alert(
(value.wrappedValue?.title).map(Text.init) ?? Text(""),
(value.wrappedValue?.title).map(Text.init) ?? Text(verbatim: ""),
isPresented: value.isPresent(),
presenting: value.wrappedValue,
actions: {
Expand All @@ -263,7 +263,7 @@
unwrapping value: Binding<AlertState<Never>?>
) -> some View {
self.alert(
(value.wrappedValue?.title).map(Text.init) ?? Text(""),
(value.wrappedValue?.title).map(Text.init) ?? Text(verbatim: ""),
isPresented: value.isPresent(),
presenting: value.wrappedValue,
actions: {
Expand Down
10 changes: 5 additions & 5 deletions Sources/SwiftUINavigation/ConfirmationDialog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
@ViewBuilder message: (Value) -> M
) -> some View {
self.confirmationDialog(
value.wrappedValue.map(title) ?? Text(""),
value.wrappedValue.map(title) ?? Text(verbatim: ""),
isPresented: value.isPresent(),
titleVisibility: titleVisibility,
presenting: value.wrappedValue,
Expand Down Expand Up @@ -130,7 +130,7 @@
action handler: @escaping (Value?) -> Void = { (_: Never?) in }
) -> some View {
self.confirmationDialog(
value.wrappedValue.flatMap { Text($0.title) } ?? Text(""),
value.wrappedValue.flatMap { Text($0.title) } ?? Text(verbatim: ""),
isPresented: value.isPresent(),
titleVisibility: value.wrappedValue.map { .init($0.titleVisibility) } ?? .automatic,
presenting: value.wrappedValue,
Expand Down Expand Up @@ -164,7 +164,7 @@
action handler: @escaping (Value?) async -> Void = { (_: Never?) async in }
) -> some View {
self.confirmationDialog(
value.wrappedValue.flatMap { Text($0.title) } ?? Text(""),
value.wrappedValue.flatMap { Text($0.title) } ?? Text(verbatim: ""),
isPresented: value.isPresent(),
titleVisibility: value.wrappedValue.map { .init($0.titleVisibility) } ?? .automatic,
presenting: value.wrappedValue,
Expand Down Expand Up @@ -240,7 +240,7 @@
action handler: @escaping (Value?) -> Void
) -> some View {
self.confirmationDialog(
value.wrappedValue.flatMap { Text($0.title) } ?? Text(""),
value.wrappedValue.flatMap { Text($0.title) } ?? Text(verbatim: ""),
isPresented: value.isPresent(),
titleVisibility: value.wrappedValue.map { .init($0.titleVisibility) } ?? .automatic,
presenting: value.wrappedValue,
Expand All @@ -259,7 +259,7 @@
action handler: @escaping (Value?) async -> Void
) -> some View {
self.confirmationDialog(
value.wrappedValue.flatMap { Text($0.title) } ?? Text(""),
value.wrappedValue.flatMap { Text($0.title) } ?? Text(verbatim: ""),
isPresented: value.isPresent(),
titleVisibility: value.wrappedValue.map { .init($0.titleVisibility) } ?? .automatic,
presenting: value.wrappedValue,
Expand Down

0 comments on commit 5eb5899

Please sign in to comment.