Przeglądaj źródła

Replace `.alert` with `.confirmationDialog` when bolusing < 54

* linting
* l18n automation
Mike Plante 1 rok temu
rodzic
commit
97f4c29ca4

+ 7 - 17
Trio/Sources/Localizations/Main/Localizable.xcstrings

@@ -13722,7 +13722,10 @@
     "≈" : {
 
     },
-    "⚠️ DANGEROUSLY LOW GLUCOSE ⚠️" : {
+    "⚠️ Enact Bolus and Ignore Warning" : {
+
+    },
+    "⚠️ Glucose is very low! Give insulin?" : {
 
     },
     "⚠️ Safety Notifications are OFF" : {
@@ -39685,9 +39688,6 @@
         }
       }
     },
-    "Cannot be negative." : {
-
-    },
     "Carb entries will be fully decayed by the number of hours specified as Max Meal Absorption Time. Meals that are high in fat and/or protein can have long lasting effects on BG levels. To allow such late meal effects to be considered by the carb decay model, a longer Max Meal Absorption Time than the default 6 hours can be set." : {
       "localizations" : {
         "ar" : {
@@ -112198,6 +112198,9 @@
         }
       }
     },
+    "No insulin recommended." : {
+
+    },
     "No Libre Transmitter Selected" : {
       "comment" : "No Libre Transmitter Selected",
       "extractionState" : "manual",
@@ -179280,9 +179283,6 @@
         }
       }
     },
-    "Yes, Deliver Insulin" : {
-
-    },
     "Yes, Import" : {
       "extractionState" : "manual",
       "localizations" : {
@@ -179934,16 +179934,6 @@
         }
       }
     },
-    "Your glucose is %@ %@, which is dangerously low!\n\nAre you sure you want to deliver insulin? This could be EXTREMELY DANGEROUS." : {
-      "localizations" : {
-        "en" : {
-          "stringUnit" : {
-            "state" : "new",
-            "value" : "Your glucose is %1$@ %2$@, which is dangerously low!\n\nAre you sure you want to deliver insulin? This could be EXTREMELY DANGEROUS."
-          }
-        }
-      }
-    },
     "Your phone or app is not enabled for NFC communications, which is needed to pair to libre2 sensors" : {
       "extractionState" : "manual",
       "localizations" : {

+ 1 - 1
Trio/Sources/Modules/Treatments/View/PopupView.swift

@@ -490,7 +490,7 @@ struct PopupView: View {
             raiseOnOverflow: false,
             raiseOnUnderflow: false,
             raiseOnDivideByZero: false
-        )   
+        )
 
         let roundedValue = NSDecimalNumber(decimal: value).rounding(accordingToBehavior: handler)
 

+ 6 - 6
Trio/Sources/Modules/Treatments/View/TreatmentsRootView.swift

@@ -409,15 +409,15 @@ extension Treatments {
             )
             .shadow(radius: 3)
             .clipShape(RoundedRectangle(cornerRadius: 8))
-            .alert("⚠️ DANGEROUSLY LOW GLUCOSE ⚠️", isPresented: $showDangerousLowAlert) {
+            .confirmationDialog(
+                "Glucose is very low! Give insulin?",
+                isPresented: $showDangerousLowAlert,
+                titleVisibility: .visible
+            ) {
                 Button("Cancel", role: .cancel) {}
-                Button("Yes, Deliver Insulin", role: .destructive) {
+                Button("Ignore Warning and Enact Bolus", role: .destructive) {
                     state.invokeTreatmentsTask()
                 }
-            } message: {
-                Text(
-                    "Your glucose is \(state.units == .mgdL ? String(describing: state.currentBG) : String(describing: state.currentBG.asMmolL)) \(state.units.rawValue), which is dangerously low!\n\nAre you sure you want to deliver insulin? This could be EXTREMELY DANGEROUS."
-                )
             }
         }