瀏覽代碼

Add missing localizations

dsnallfot 1 年之前
父節點
當前提交
d540ef6941

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

@@ -1224,6 +1224,9 @@
         }
       }
     },
+    " %@/U" : {
+
+    },
     " + " : {
       "localizations" : {
         "ar" : {
@@ -1763,6 +1766,9 @@
         }
       }
     },
+    " g/U" : {
+
+    },
     " infinite duration." : {
       "comment" : "Alert strings. Keep spaces",
       "extractionState" : "manual",
@@ -2203,6 +2209,9 @@
         }
       }
     },
+    " needed as min. Glucose Target)!" : {
+
+    },
     " of " : {
       "comment" : "Bolus string partial message: 'x U of y U' in home view"
     },
@@ -26204,6 +26213,9 @@
         }
       }
     },
+    "All settings are at default values." : {
+
+    },
     "Allow Bolusing with Shortcuts" : {
       "localizations" : {
         "ar" : {
@@ -28004,6 +28016,9 @@
     "Alter the rate of dynamic sensitivity adjustments for Sigmoid." : {
 
     },
+    "Always" : {
+      "extractionState" : "manual"
+    },
     "Always Color Glucose Value (green, yellow etc)" : {
       "comment" : "UI/UX option",
       "extractionState" : "manual",
@@ -59238,6 +59253,12 @@
         }
       }
     },
+    "Disable" : {
+      "extractionState" : "manual"
+    },
+    "Disable on Schedule" : {
+      "extractionState" : "manual"
+    },
     "Disable SMBs" : {
       "localizations" : {
         "ar" : {
@@ -62856,6 +62877,9 @@
         }
       }
     },
+    "Don't Disable" : {
+      "extractionState" : "manual",
+    },
     "Done" : {
       "comment" : "Button",
       "extractionState" : "manual",
@@ -66250,6 +66274,9 @@
         }
       }
     },
+    "Enable indefinitely or set a duration." : {
+
+    },
     "Enable Live Activity" : {
       "localizations" : {
         "ar" : {
@@ -98321,6 +98348,9 @@
     "Live Activity Expired. Open Trio to Refresh" : {
 
     },
+    "Live Activity Personalization" : {
+
+    },
     "Local glucose source" : {
       "extractionState" : "manual",
       "localizations" : {
@@ -115990,6 +116020,9 @@
         }
       }
     },
+    "Note..." : {
+
+    },
     "Notes" : {
       "localizations" : {
         "ar" : {
@@ -118267,6 +118300,9 @@
         }
       }
     },
+    "Only Alarm Limits" : {
+      "extractionState" : "manual"
+    },
     "Only Alarm Limits:" : {
       "localizations" : {
         "ar" : {
@@ -124021,6 +124057,9 @@
         }
       }
     },
+    "Presets can't be saved with a future date!" : {
+
+    },
     "Preview Contact Image" : {
 
     },
@@ -136609,6 +136648,9 @@
     "Set a custom time for peak insulin effect." : {
       "comment" : "Mini Hint for Insulin Peak Time"
     },
+    "Set a duration!" : {
+
+    },
     "Set Display Values" : {
 
     },
@@ -149512,6 +149554,9 @@
         }
       }
     },
+    "Target glucose is out of range (%@)." : {
+
+    },
     "Target presets" : {
       "comment" : "Debug option view Target presets",
       "extractionState" : "manual",
@@ -180472,4 +180517,4 @@
     }
   },
   "version" : "1.0"
-}
+}

+ 3 - 3
Trio/Sources/Modules/Adjustments/View/Overrides/AddOverrideForm.swift

@@ -448,15 +448,15 @@ struct AddOverrideForm: View {
             !state.advancedSettings && !state.smbIsOff && !state.smbIsScheduledOff
 
         if noDurationSpecified {
-            return (true, "Enable indefinitely or set a duration.")
+            return (true, String(localized: "Enable indefinitely or set a duration."))
         }
 
         if targetZeroWithOverride {
-            return (true, "Target glucose is out of range (\(state.units == .mgdL ? "72-270" : "4-14")).")
+            return (true, String(localized: "Target glucose is out of range (\(state.units == .mgdL ? "72-270" : "4-14"))."))
         }
 
         if allSettingsDefault {
-            return (true, "All settings are at default values.")
+            return (true, String(localized: "All settings are at default values."))
         }
 
         return (false, nil)

+ 3 - 3
Trio/Sources/Modules/Adjustments/View/Overrides/EditOverrideForm.swift

@@ -557,15 +557,15 @@ struct EditOverrideForm: View {
             !smbIsOff && !smbIsScheduledOff
 
         if noDurationSpecified {
-            return (true, "Enable indefinitely or set a duration.")
+            return (true, String(localized: "Enable indefinitely or set a duration."))
         }
 
         if targetZeroWithOverride {
-            return (true, "Target glucose is out of range (\(state.units == .mgdL ? "72-270" : "4-14")).")
+            return (true, String(localized: "Target glucose is out of range (\(state.units == .mgdL ? "72-270" : "4-14"))."))
         }
 
         if allSettingsDefault {
-            return (true, "All settings are at default values.")
+            return (true, String(localized: "All settings are at default values."))
         }
 
         if !hasChanges {

+ 5 - 4
Trio/Sources/Modules/Adjustments/View/TempTargets/AddTempTargetForm.swift

@@ -84,7 +84,7 @@ struct AddTempTargetForm: View {
                 let settingsProvider = PickerSettingsProvider.shared
                 let glucoseSetting = PickerSetting(value: 0, step: targetStep, min: 80, max: 200, type: .glucose)
                 TargetPicker(
-                    label: "Target Glucose",
+                    label: String(localized: "Target Glucose"),
                     selection: Binding(
                         get: { state.tempTargetTarget },
                         set: { state.tempTargetTarget = $0 }
@@ -205,13 +205,14 @@ struct AddTempTargetForm: View {
         let targetZero = state.tempTargetTarget < 80
 
         if noDurationSpecified {
-            return (true, "Set a duration!")
+            return (true, String(localized: "Set a duration!"))
         }
 
         if targetZero {
             return (
                 true,
-                "\(state.units == .mgdL ? "80 " : "4.4 ")" + state.units.rawValue + " needed as min. Glucose Target!"
+                "\(state.units == .mgdL ? "80 " : "4.4 ")" + state.units
+                    .rawValue + String(localized: " needed as min. Glucose Target)!")
             )
         }
 
@@ -227,7 +228,7 @@ struct AddTempTargetForm: View {
         }
 
         if isDateInFuture {
-            return (true, "Presets can't be saved with a future date!")
+            return (true, String(localized: "Presets can't be saved with a future date!"))
         }
 
         return (false, nil)

+ 1 - 1
Trio/Sources/Modules/BasalProfileEditor/View/BasalProfileEditorRootView.swift

@@ -198,7 +198,7 @@ extension BasalProfileEditor {
                                 (
                                     self.rateFormatter
                                         .string(from: state.rateValues[i] as NSNumber) ?? ""
-                                ) + " U/hr"
+                                ) + String(localized: " U/hr")
                             ).tag(i)
                         }
                     }

+ 4 - 2
Trio/Sources/Modules/CarbRatioEditor/View/CarbRatioEditorRootView.swift

@@ -128,7 +128,7 @@ extension CarbRatioEditor {
                                 (
                                     self.rateFormatter
                                         .string(from: state.rateValues[i] as NSNumber) ?? ""
-                                ) + " g/U"
+                                ) + String(localized: " g/U")
                             ).tag(i)
                         }
                     }
@@ -163,7 +163,9 @@ extension CarbRatioEditor {
                         HStack {
                             Text("Ratio").foregroundColor(.secondary)
                             Text(
-                                "\(rateFormatter.string(from: state.rateValues[item.rateIndex] as NSNumber) ?? "0") g/U"
+                                String(
+                                    localized: "\(rateFormatter.string(from: state.rateValues[item.rateIndex] as NSNumber) ?? "0") g/U"
+                                )
                             )
                             Spacer()
                             Text("starts at").foregroundColor(.secondary)

+ 1 - 1
Trio/Sources/Modules/DataTable/View/CarbEntryEditorView.swift

@@ -161,7 +161,7 @@ struct CarbEntryEditorView: View {
 
                     HStack {
                         Image(systemName: "square.and.pencil")
-                        TextFieldWithToolBarString(text: $editedNote, placeholder: "Note...", maxLength: 25)
+                        TextFieldWithToolBarString(text: $editedNote, placeholder: String(localized: "Note..."), maxLength: 25)
                     }
                 }.listRowBackground(Color.chart)
 

+ 2 - 2
Trio/Sources/Modules/ISFEditor/View/ISFEditorRootView.swift

@@ -124,7 +124,7 @@ extension ISFEditor {
                         ForEach(0 ..< state.rateValues.count, id: \.self) { i in
                             Text(
                                 state.units == .mgdL ? state.rateValues[i].description : state.rateValues[i]
-                                    .formattedAsMmolL + " \(state.units.rawValue)/U"
+                                    .formattedAsMmolL + String(localized: " \(state.units.rawValue)/U")
                             ).tag(i)
                         }
                     }
@@ -162,7 +162,7 @@ extension ISFEditor {
                             Text("Rate").foregroundColor(.secondary)
 
                             Text(
-                                displayValue + " \(state.units.rawValue)/U"
+                                displayValue + String(localized: " \(state.units.rawValue)/U")
                             )
                             Spacer()
                             Text("starts at").foregroundColor(.secondary)

+ 1 - 1
Trio/Sources/Modules/LiveActivitySettings/View/LiveActivityWidgetConfiguration.swift

@@ -78,7 +78,7 @@ struct LiveActivityWidgetConfiguration: BaseView {
         VStack {
             Group {
                 VStack(alignment: .trailing, spacing: 0) {
-                    Text("Live Activity Personalization".uppercased())
+                    Text(String(localized: "Live Activity Personalization").uppercased())
                         .frame(maxWidth: .infinity, alignment: .leading)
                         .foregroundColor(.secondary)
                         .font(.footnote)

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

@@ -228,7 +228,11 @@ extension Treatments {
                             // Notes
                             HStack {
                                 Image(systemName: "square.and.pencil")
-                                TextFieldWithToolBarString(text: $state.note, placeholder: "Note...", maxLength: 25)
+                                TextFieldWithToolBarString(
+                                    text: $state.note,
+                                    placeholder: String(localized: "Note..."),
+                                    maxLength: 25
+                                )
                             }
                         }.listRowBackground(Color.chart)
 
@@ -457,7 +461,7 @@ extension Treatments {
             let hasInsulin = state.amount > 0
             let hasCarbs = state.carbs > 0
             let hasFatOrProtein = state.fat > 0 || state.protein > 0
-            let bolusString = state.externalInsulin ? "External Insulin" : "Enact Bolus"
+            let bolusString = state.externalInsulin ? String(localized: "External Insulin") : String(localized: "Enact Bolus")
 
             if state.isBolusInProgress && hasInsulin && !state.externalInsulin && (!hasCarbs || !hasFatOrProtein) {
                 return Text("Bolus In Progress...")