Преглед изворни кода

Rename Fat And Protein Conversion settings section to Meal Settings, move Max Carbs from Pump Settings to Meal Settings

Reset all relevant localised strings and replaced:
- Fat And Protein Conversion with Meal Settings
- Conversion settings with Fat and Protein Conversion Settings
bjornoleh пре 2 година
родитељ
комит
ac63050e9e
28 измењених фајлова са 75 додато и 66 уклоњено
  1. 2 2
      FreeAPS/Sources/Localizations/Main/ar.lproj/Localizable.strings
  2. 2 2
      FreeAPS/Sources/Localizations/Main/ca.lproj/Localizable.strings
  3. 3 3
      FreeAPS/Sources/Localizations/Main/da.lproj/Localizable.strings
  4. 3 3
      FreeAPS/Sources/Localizations/Main/de.lproj/Localizable.strings
  5. 2 2
      FreeAPS/Sources/Localizations/Main/en.lproj/Localizable.strings
  6. 2 2
      FreeAPS/Sources/Localizations/Main/es.lproj/Localizable.strings
  7. 2 2
      FreeAPS/Sources/Localizations/Main/fi.lproj/Localizable.strings
  8. 3 3
      FreeAPS/Sources/Localizations/Main/fr.lproj/Localizable.strings
  9. 2 2
      FreeAPS/Sources/Localizations/Main/he.lproj/Localizable.strings
  10. 2 2
      FreeAPS/Sources/Localizations/Main/hu.lproj/Localizable.strings
  11. 3 3
      FreeAPS/Sources/Localizations/Main/it.lproj/Localizable.strings
  12. 3 3
      FreeAPS/Sources/Localizations/Main/nb.lproj/Localizable.strings
  13. 3 3
      FreeAPS/Sources/Localizations/Main/nl.lproj/Localizable.strings
  14. 2 2
      FreeAPS/Sources/Localizations/Main/pl.lproj/Localizable.strings
  15. 2 2
      FreeAPS/Sources/Localizations/Main/pt-BR.lproj/Localizable.strings
  16. 2 2
      FreeAPS/Sources/Localizations/Main/pt-PT.lproj/Localizable.strings
  17. 3 3
      FreeAPS/Sources/Localizations/Main/ru.lproj/Localizable.strings
  18. 3 3
      FreeAPS/Sources/Localizations/Main/sk.lproj/Localizable.strings
  19. 3 3
      FreeAPS/Sources/Localizations/Main/sv.lproj/Localizable.strings
  20. 2 2
      FreeAPS/Sources/Localizations/Main/tr.lproj/Localizable.strings
  21. 3 3
      FreeAPS/Sources/Localizations/Main/uk.lproj/Localizable.strings
  22. 3 3
      FreeAPS/Sources/Localizations/Main/vi.lproj/Localizable.strings
  23. 2 2
      FreeAPS/Sources/Localizations/Main/zh-Hans.lproj/Localizable.strings
  24. 2 0
      FreeAPS/Sources/Modules/FPUConfig/FPUConfigStateModel.swift
  25. 15 2
      FreeAPS/Sources/Modules/FPUConfig/View/FPUConfigRootView.swift
  26. 0 2
      FreeAPS/Sources/Modules/PumpSettingsEditor/PumpSettingsEditorStateModel.swift
  27. 0 4
      FreeAPS/Sources/Modules/PumpSettingsEditor/View/PumpSettingsEditorRootView.swift
  28. 1 1
      FreeAPS/Sources/Modules/Settings/View/SettingsRootView.swift

+ 2 - 2
FreeAPS/Sources/Localizations/Main/ar.lproj/Localizable.strings

@@ -1240,7 +1240,7 @@ Enact a temp Basal or a temp target */
 "Enable" = "Enable";
 
 /* Header */
-"Conversion settings" = "Conversion settings";
+"Fat and Protein Conversion Settings" = "Fat and Protein Conversion Settings";
 
 /* Delay */
 "Delay In Minutes" = "Delay In Minutes";
@@ -1273,7 +1273,7 @@ Enact a temp Basal or a temp target */
 "Protein" = "Protein";
 
 /* Service Section */
-"Fat And Protein Conversion" = "Fat And Protein Conversion";
+"Meal Settings" = "Meal Settings";
 
 /* Service Section */
 "Profile Override" = "Profile Override";

+ 2 - 2
FreeAPS/Sources/Localizations/Main/ca.lproj/Localizable.strings

@@ -1121,7 +1121,7 @@ Enact a temp Basal or a temp target */
 "Enable" = "Enable";
 
 /* Header */
-"Conversion settings" = "Conversion settings";
+"Fat and Protein Conversion Settings" = "Fat and Protein Conversion Settings";
 
 /* Delay */
 "Delay In Minutes" = "Delay In Minutes";
@@ -1154,7 +1154,7 @@ Enact a temp Basal or a temp target */
 "Protein" = "Protein";
 
 /* Service Section */
-"Fat And Protein Conversion" = "Fat And Protein Conversion";
+"Meal Settings" = "Meal Settings";
 
 /* Service Section */
 "Profile Override" = "Profile Override";

Разлика између датотеке није приказан због своје велике величине
+ 3 - 3
FreeAPS/Sources/Localizations/Main/da.lproj/Localizable.strings


Разлика између датотеке није приказан због своје велике величине
+ 3 - 3
FreeAPS/Sources/Localizations/Main/de.lproj/Localizable.strings


+ 2 - 2
FreeAPS/Sources/Localizations/Main/en.lproj/Localizable.strings

@@ -1241,7 +1241,7 @@ Enact a temp Basal or a temp target */
 "Enable" = "Enable";
 
 /* Header */
-"Conversion settings" = "Conversion settings";
+"Fat and Protein Conversion Settings" = "Fat and Protein Conversion Settings";
 
 /* Delay */
 "Delay In Minutes" = "Delay In Minutes";
@@ -1274,7 +1274,7 @@ Enact a temp Basal or a temp target */
 "Protein" = "Protein";
 
 /* Service Section */
-"Fat And Protein Conversion" = "Fat And Protein Conversion";
+"Meal Settings" = "Meal Settings";
 
 /* Service Section */
 "Profile Override" = "Profile Override";

+ 2 - 2
FreeAPS/Sources/Localizations/Main/es.lproj/Localizable.strings

@@ -1239,7 +1239,7 @@ Enact a temp Basal or a temp target */
 "Enable" = "Enable";
 
 /* Header */
-"Conversion settings" = "Conversion settings";
+"Fat and Protein Conversion Settings" = "Fat and Protein Conversion Settings";
 
 /* Delay */
 "Delay In Minutes" = "Delay In Minutes";
@@ -1272,7 +1272,7 @@ Enact a temp Basal or a temp target */
 "Protein" = "Protein";
 
 /* Service Section */
-"Fat And Protein Conversion" = "Fat And Protein Conversion";
+"Meal Settings" = "Meal Settings";
 
 /* Service Section */
 "Profile Override" = "Profile Override";

+ 2 - 2
FreeAPS/Sources/Localizations/Main/fi.lproj/Localizable.strings

@@ -1240,7 +1240,7 @@ Enact a temp Basal or a temp target */
 "Enable" = "Enable";
 
 /* Header */
-"Conversion settings" = "Conversion settings";
+"Fat and Protein Conversion Settings" = "Fat and Protein Conversion Settings";
 
 /* Delay */
 "Delay In Minutes" = "Delay In Minutes";
@@ -1273,7 +1273,7 @@ Enact a temp Basal or a temp target */
 "Protein" = "Protein";
 
 /* Service Section */
-"Fat And Protein Conversion" = "Fat And Protein Conversion";
+"Meal Settings" = "Meal Settings";
 
 /* Service Section */
 "Profile Override" = "Profile Override";

Разлика између датотеке није приказан због своје велике величине
+ 3 - 3
FreeAPS/Sources/Localizations/Main/fr.lproj/Localizable.strings


+ 2 - 2
FreeAPS/Sources/Localizations/Main/he.lproj/Localizable.strings

@@ -1240,7 +1240,7 @@ Enact a temp Basal or a temp target */
 "Enable" = "Enable";
 
 /* Header */
-"Conversion settings" = "Conversion settings";
+"Fat and Protein Conversion Settings" = "Fat and Protein Conversion Settings";
 
 /* Delay */
 "Delay In Minutes" = "Delay In Minutes";
@@ -1273,7 +1273,7 @@ Enact a temp Basal or a temp target */
 "Protein" = "Protein";
 
 /* Service Section */
-"Fat And Protein Conversion" = "Fat And Protein Conversion";
+"Meal Settings" = "Meal Settings";
 
 /* Service Section */
 "Profile Override" = "Profile Override";

+ 2 - 2
FreeAPS/Sources/Localizations/Main/hu.lproj/Localizable.strings

@@ -1240,7 +1240,7 @@ Enact a temp Basal or a temp target */
 "Enable" = "Enable";
 
 /* Header */
-"Conversion settings" = "Conversion settings";
+"Fat and Protein Conversion Settings" = "Fat and Protein Conversion Settings";
 
 /* Delay */
 "Delay In Minutes" = "Delay In Minutes";
@@ -1273,7 +1273,7 @@ Enact a temp Basal or a temp target */
 "Protein" = "Protein";
 
 /* Service Section */
-"Fat And Protein Conversion" = "Fat And Protein Conversion";
+"Meal Settings" = "Meal Settings";
 
 /* Service Section */
 "Profile Override" = "Profile Override";

Разлика између датотеке није приказан због своје велике величине
+ 3 - 3
FreeAPS/Sources/Localizations/Main/it.lproj/Localizable.strings


Разлика између датотеке није приказан због своје велике величине
+ 3 - 3
FreeAPS/Sources/Localizations/Main/nb.lproj/Localizable.strings


Разлика између датотеке није приказан због своје велике величине
+ 3 - 3
FreeAPS/Sources/Localizations/Main/nl.lproj/Localizable.strings


+ 2 - 2
FreeAPS/Sources/Localizations/Main/pl.lproj/Localizable.strings

@@ -1242,7 +1242,7 @@ Połączono z Nightscout!";
 "Enable" = "Enable";
 
 /* Header */
-"Conversion settings" = "Conversion settings";
+"Fat and Protein Conversion Settings" = "Fat and Protein Conversion Settings";
 
 /* Delay */
 "Delay In Minutes" = "Delay In Minutes";
@@ -1275,7 +1275,7 @@ Połączono z Nightscout!";
 "Protein" = "Protein";
 
 /* Service Section */
-"Fat And Protein Conversion" = "Fat And Protein Conversion";
+"Meal Settings" = "Meal Settings";
 
 /* Service Section */
 "Profile Override" = "Profile Override";

+ 2 - 2
FreeAPS/Sources/Localizations/Main/pt-BR.lproj/Localizable.strings

@@ -1240,7 +1240,7 @@ Enact a temp Basal or a temp target */
 "Enable" = "Enable";
 
 /* Header */
-"Conversion settings" = "Conversion settings";
+"Fat and Protein Conversion Settings" = "Fat and Protein Conversion Settings";
 
 /* Delay */
 "Delay In Minutes" = "Delay In Minutes";
@@ -1273,7 +1273,7 @@ Enact a temp Basal or a temp target */
 "Protein" = "Protein";
 
 /* Service Section */
-"Fat And Protein Conversion" = "Fat And Protein Conversion";
+"Meal Settings" = "Meal Settings";
 
 /* Service Section */
 "Profile Override" = "Profile Override";

+ 2 - 2
FreeAPS/Sources/Localizations/Main/pt-PT.lproj/Localizable.strings

@@ -1240,7 +1240,7 @@ Enact a temp Basal or a temp target */
 "Enable" = "Enable";
 
 /* Header */
-"Conversion settings" = "Conversion settings";
+"Fat and Protein Conversion Settings" = "Fat and Protein Conversion Settings";
 
 /* Delay */
 "Delay In Minutes" = "Delay In Minutes";
@@ -1273,7 +1273,7 @@ Enact a temp Basal or a temp target */
 "Protein" = "Protein";
 
 /* Service Section */
-"Fat And Protein Conversion" = "Fat And Protein Conversion";
+"Meal Settings" = "Meal Settings";
 
 /* Service Section */
 "Profile Override" = "Profile Override";

Разлика између датотеке није приказан због своје велике величине
+ 3 - 3
FreeAPS/Sources/Localizations/Main/ru.lproj/Localizable.strings


Разлика између датотеке није приказан због своје велике величине
+ 3 - 3
FreeAPS/Sources/Localizations/Main/sk.lproj/Localizable.strings


Разлика између датотеке није приказан због своје велике величине
+ 3 - 3
FreeAPS/Sources/Localizations/Main/sv.lproj/Localizable.strings


+ 2 - 2
FreeAPS/Sources/Localizations/Main/tr.lproj/Localizable.strings

@@ -1244,7 +1244,7 @@ Enact a temp Basal or a temp target */
 "Enable" = "Enable";
 
 /* Header */
-"Conversion settings" = "Conversion settings";
+"Fat and Protein Conversion Settings" = "Fat and Protein Conversion Settings";
 
 /* Delay */
 "Delay In Minutes" = "Delay In Minutes";
@@ -1277,7 +1277,7 @@ Enact a temp Basal or a temp target */
 "Protein" = "Protein";
 
 /* Service Section */
-"Fat And Protein Conversion" = "Fat And Protein Conversion";
+"Meal Settings" = "Meal Settings";
 
 /* Service Section */
 "Profile Override" = "Profile Override";

Разлика између датотеке није приказан због своје велике величине
+ 3 - 3
FreeAPS/Sources/Localizations/Main/uk.lproj/Localizable.strings


Разлика између датотеке није приказан због своје велике величине
+ 3 - 3
FreeAPS/Sources/Localizations/Main/vi.lproj/Localizable.strings


+ 2 - 2
FreeAPS/Sources/Localizations/Main/zh-Hans.lproj/Localizable.strings

@@ -1240,7 +1240,7 @@ Enact a temp Basal or a temp target */
 "Enable" = "Enable";
 
 /* Header */
-"Conversion settings" = "Conversion settings";
+"Fat and Protein Conversion Settings" = "Fat and Protein Conversion Settings";
 
 /* Delay */
 "Delay In Minutes" = "Delay In Minutes";
@@ -1273,7 +1273,7 @@ Enact a temp Basal or a temp target */
 "Protein" = "Protein";
 
 /* Service Section */
-"Fat And Protein Conversion" = "Fat And Protein Conversion";
+"Meal Settings" = "Meal Settings";
 
 /* Service Section */
 "Profile Override" = "Profile Override";

+ 2 - 0
FreeAPS/Sources/Modules/FPUConfig/FPUConfigStateModel.swift

@@ -2,12 +2,14 @@ import SwiftUI
 
 extension FPUConfig {
     final class StateModel: BaseStateModel<Provider> {
+        @Published var maxCarbs: Decimal = 1000
         @Published var individualAdjustmentFactor: Decimal = 0
         @Published var timeCap: Decimal = 0
         @Published var minuteInterval: Decimal = 0
         @Published var delay: Decimal = 0
 
         override func subscribe() {
+            subscribeSetting(\.maxCarbs, on: $maxCarbs) { maxCarbs = $0 }
             subscribeSetting(\.timeCap, on: $timeCap.map(Int.init), initial: {
                 let value = max(min($0, 12), 5)
                 timeCap = Decimal(value)

+ 15 - 2
FreeAPS/Sources/Modules/FPUConfig/View/FPUConfigRootView.swift

@@ -20,9 +20,22 @@ extension FPUConfig {
             return formatter
         }
 
+        private var formatter: NumberFormatter {
+            let formatter = NumberFormatter()
+            formatter.numberStyle = .decimal
+            return formatter
+        }
+
         var body: some View {
             Form {
-                Section(header: Text("Conversion settings")) {
+                Section(header: Text("Carbohydrate limit")) {
+                    HStack {
+                        Text("Max Carbs")
+                        DecimalTextField("g", value: $state.maxCarbs, formatter: formatter)
+                    }
+                }
+
+                Section(header: Text("Fat and Protein Conversion Settings")) {
                     HStack {
                         Text("Delay In Minutes")
                         Spacer()
@@ -53,7 +66,7 @@ extension FPUConfig {
                     {}
             }
             .onAppear(perform: configureView)
-            .navigationBarTitle("Fat and Protein")
+            .navigationBarTitle("Meal Settings")
             .navigationBarTitleDisplayMode(.automatic)
         }
     }

+ 0 - 2
FreeAPS/Sources/Modules/PumpSettingsEditor/PumpSettingsEditorStateModel.swift

@@ -5,7 +5,6 @@ extension PumpSettingsEditor {
         @Published var maxBasal: Decimal = 0.0
         @Published var maxBolus: Decimal = 0.0
         @Published var dia: Decimal = 0.0
-        @Published var maxCarbs: Decimal = 1000
 
         @Published var syncInProgress = false
 
@@ -14,7 +13,6 @@ extension PumpSettingsEditor {
             maxBasal = settings.maxBasal
             maxBolus = settings.maxBolus
             dia = settings.insulinActionCurve
-            subscribeSetting(\.maxCarbs, on: $maxCarbs) { maxCarbs = $0 }
         }
 
         func save() {

+ 0 - 4
FreeAPS/Sources/Modules/PumpSettingsEditor/View/PumpSettingsEditorRootView.swift

@@ -23,10 +23,6 @@ extension PumpSettingsEditor {
                         Text("Max Bolus")
                         DecimalTextField("U", value: $state.maxBolus, formatter: formatter)
                     }
-                    HStack {
-                        Text("Max Carbs")
-                        DecimalTextField("g", value: $state.maxCarbs, formatter: formatter)
-                    }
                 }
 
                 Section(header: Text("Duration of Insulin Action")) {

+ 1 - 1
FreeAPS/Sources/Modules/Settings/View/SettingsRootView.swift

@@ -37,7 +37,7 @@ extension Settings {
                         Text("Apple Health").navigationLink(to: .healthkit, from: self)
                     }
                     Text("Notifications").navigationLink(to: .notificationsConfig, from: self)
-                    Text("Fat And Protein Conversion").navigationLink(to: .fpuConfig, from: self)
+                    Text("Meal Settings").navigationLink(to: .fpuConfig, from: self)
                     Text("App Icons").navigationLink(to: .iconConfig, from: self)
                     Text("Statistics and Home View").navigationLink(to: .statisticsConfig, from: self)
                 } header: { Text("Services") }