Forráskód Böngészése

Fix max basal setting
* Correct setting name 'Max Basal' -> 'Max Basal Rate'
* Correct setting unit 'U' -> 'U/hr'
* Adjust implementation and handling accordingly

Deniz Cengiz 1 éve
szülő
commit
952cfeb416

+ 9 - 1
Trio/Sources/Localizations/Main/Localizable.xcstrings

@@ -65391,7 +65391,11 @@
         }
       }
     },
+    "Default: 2 %@" : {
+
+    },
     "Default: 2 units" : {
+      "extractionState" : "stale",
       "localizations" : {
         "bg" : {
           "stringUnit" : {
@@ -126814,6 +126818,7 @@
     },
     "Max Basal" : {
       "comment" : "Max setting",
+      "extractionState" : "stale",
       "localizations" : {
         "bg" : {
           "stringUnit" : {
@@ -126913,6 +126918,9 @@
         }
       }
     },
+    "Max Basal Rate" : {
+
+    },
     "Max bolus" : {
       "localizations" : {
         "bg" : {
@@ -206979,7 +206987,7 @@
 
     },
     "U/hr" : {
-      "comment" : "Insulin unit per hour",
+      "comment" : "Insulin unit per hour abbreviation",
       "localizations" : {
         "bg" : {
           "stringUnit" : {

+ 8 - 1
Trio/Sources/Models/DecimalPickerSettings.swift

@@ -137,7 +137,13 @@ struct DecimalPickerSettings {
     var hours = PickerSetting(value: 6, step: 0.5, min: 2, max: 24, type: PickerSetting.PickerSettingType.hour)
     var dia = PickerSetting(value: 10, step: 0.5, min: 5, max: 10, type: PickerSetting.PickerSettingType.hour)
     var maxBolus = PickerSetting(value: 10, step: 0.5, min: 0.5, max: 30, type: PickerSetting.PickerSettingType.insulinUnit)
-    var maxBasal = PickerSetting(value: 10, step: 0.5, min: 0.5, max: 30, type: PickerSetting.PickerSettingType.insulinUnit)
+    var maxBasal = PickerSetting(
+        value: 10,
+        step: 0.5,
+        min: 0.5,
+        max: 30,
+        type: PickerSetting.PickerSettingType.insulinUnitPerHour
+    )
 }
 
 struct PickerSetting {
@@ -152,6 +158,7 @@ struct PickerSetting {
         case factor
         case gram
         case insulinUnit
+        case insulinUnitPerHour
         case minute
         case hour
     }

+ 3 - 3
Trio/Sources/Modules/GeneralSettings/View/UnitsLimitsSettingsRootView.swift

@@ -95,16 +95,16 @@ extension UnitsLimitsSettings {
                         get: { selectedVerboseHint },
                         set: {
                             selectedVerboseHint = $0.map { AnyView($0) }
-                            hintLabel = String(localized: "Max Basal")
+                            hintLabel = String(localized: "Max Basal Rate")
                         }
                     ),
                     units: state.units,
                     type: .decimal("maxBasal"),
-                    label: String(localized: "Max Basal"),
+                    label: String(localized: "Max Basal Rate"),
                     miniHint: String(localized: "Largest basal rate allowed."),
                     verboseHint:
                     VStack(alignment: .leading, spacing: 10) {
-                        Text("Default: 2 units").bold()
+                        Text("Default: 2 \(String(localized: "U/hr", comment: "Insulin unit per hour abbreviation"))").bold()
                         Text(
                             "This is the maximum basal rate allowed to be set or scheduled. This applies to both automatic and manual basal rates."
                         )

+ 3 - 2
Trio/Sources/Modules/Onboarding/View/OnboardingSteps/DeliveryLimitsStepView.swift

@@ -94,8 +94,9 @@ struct DeliveryLimitsStepView: View {
 
     private func displayText(for substep: DeliveryLimitSubstep, decimalValue: Decimal) -> Text {
         switch substep {
-        case .maxBasal,
-             .maxBolus,
+        case .maxBasal:
+            return Text("\(decimalValue) \(String(localized: "U/hr", comment: "Insulin unit per hour abbreviation"))")
+        case .maxBolus,
              .maxIOB:
             return Text("\(decimalValue) \(String(localized: "U", comment: "Insulin unit abbreviation"))")
         case .maxCOB:

+ 1 - 1
Trio/Sources/Modules/Onboarding/View/OnboardingView+Util.swift

@@ -173,7 +173,7 @@ enum DeliveryLimitSubstep: Int, CaseIterable, Identifiable {
         switch self {
         case .maxIOB: return String(localized: "Max IOB", comment: "Max IOB")
         case .maxBolus: return String(localized: "Max Bolus")
-        case .maxBasal: return String(localized: "Max Basal")
+        case .maxBasal: return String(localized: "Max Basal Rate")
         case .maxCOB: return String(localized: "Max COB", comment: "Max COB")
         case .minimumSafetyThreshold: return String(localized: "Minimum Safety Threshold")
         }

+ 2 - 0
Trio/Sources/Views/SettingInputSection.swift

@@ -222,6 +222,8 @@ struct SettingInputSection<VerboseHint: View>: View {
             return Text("\(decimalValue * 100) \(String(localized: "%", comment: "Percentage symbol"))")
         case .insulinUnit:
             return Text("\(decimalValue) \(String(localized: "U", comment: "Insulin unit abbreviation"))")
+        case .insulinUnitPerHour:
+            return Text("\(decimalValue) \(String(localized: "U/hr", comment: "Insulin unit per hour abbreviation"))")
         case .gram:
             return Text("\(decimalValue) \(String(localized: "g", comment: "Gram abbreviation"))")
         case .minute: