فهرست منبع

Display maxBolus value when exceeded

also revert duplicate localization (thanks @bjornoleh )
Mike Plante 2 سال پیش
والد
کامیت
621afd4ebe

+ 0 - 3
FreeAPS/Sources/Localizations/Main/sv.lproj/Localizable.strings

@@ -1058,9 +1058,6 @@ Enact a temp Basal or a temp target */
 /* */
 "Bolus failed or inaccurate. Check pump history before repeating." = "Misslyckad eller felaktig bolus. Kontrollera pumpens historik innan du försöker igen.";
 
-/* "Max Bolus Exceeded label" */
-"Max Bolus exceeded!" = "Du kan inte ge mer än din maxinställning!";
-
 /* */
 "Carbs" = "Kolhydrater";
 

+ 8 - 1
FreeAPS/Sources/Modules/Bolus/View/BolusRootView.swift

@@ -78,7 +78,14 @@ extension Bolus {
                     header: { Text("Bolus") }
                     Section {
                         Button { state.add() }
-                        label: { Text(!(state.amount > state.maxBolus) ? "Enact bolus" : "Max Bolus exceeded!") }
+                        label: {
+                            Text(
+                                state.amount < state.maxBolus ? NSLocalizedString("Enact bolus", comment: "") :
+                                    NSLocalizedString("Max Bolus exceeded!", comment: "")
+                                    + " (>"
+                                    + formatter.string(from: state.maxBolus as NSNumber)!
+                                    + ")"
+                            ) }
                             .disabled(
                                 state.amount <= 0 || state.amount > state.maxBolus
                             )