From 33b6dcf70b419a8fd4af5cf029751cc75342493c Mon Sep 17 00:00:00 2001 From: Robert Date: Sun, 5 May 2024 09:23:45 +0200 Subject: [PATCH 1/2] TempTarget Shortcut md/dL instead of mg/L for instead of during --- .../ShortcutsDetail/ShortcutsDetail.xcstrings | 13 ++++++++++++- .../TempPresets/CancelTempPresetIntent.swift | 4 ++-- .../TempPresets/CreateAndApplyTempTarget.swift | 4 ++-- .../TempPresets/TempPresetsIntentRequest.swift | 2 +- .../Sources/Shortcuts/TempPresets/UnitIntent.swift | 4 ++-- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/FreeAPS/Sources/Localizations/ShortcutsDetail/ShortcutsDetail.xcstrings b/FreeAPS/Sources/Localizations/ShortcutsDetail/ShortcutsDetail.xcstrings index 920e609bde..bf302ad7cb 100644 --- a/FreeAPS/Sources/Localizations/ShortcutsDetail/ShortcutsDetail.xcstrings +++ b/FreeAPS/Sources/Localizations/ShortcutsDetail/ShortcutsDetail.xcstrings @@ -639,6 +639,7 @@ } }, "Cancel a temporary Preset" : { + "extractionState" : "stale", "localizations" : { "de" : { "stringUnit" : { @@ -677,8 +678,12 @@ } } } + }, + "Cancel a Temporary Target" : { + }, "Cancel temporary preset" : { + "extractionState" : "stale", "localizations" : { "de" : { "stringUnit" : { @@ -717,6 +722,9 @@ } } } + }, + "Cancel Temporary Target" : { + }, "carbs" : { "localizations" : { @@ -1670,6 +1678,9 @@ } } } + }, + "mg/dL" : { + }, "mg/L" : { "extractionState" : "manual", @@ -2255,7 +2266,7 @@ } } }, - "Start ${target} ${unit} target during ${duration} min" : { + "Start ${target} ${unit} target for ${duration} min" : { "extractionState" : "manual", "localizations" : { "de" : { diff --git a/FreeAPS/Sources/Shortcuts/TempPresets/CancelTempPresetIntent.swift b/FreeAPS/Sources/Shortcuts/TempPresets/CancelTempPresetIntent.swift index 128f11efbd..10dcdfd66d 100644 --- a/FreeAPS/Sources/Shortcuts/TempPresets/CancelTempPresetIntent.swift +++ b/FreeAPS/Sources/Shortcuts/TempPresets/CancelTempPresetIntent.swift @@ -3,10 +3,10 @@ import Foundation @available(iOS 16.0, *) struct CancelTempPresetIntent: AppIntent { // Title of the action in the Shortcuts app - static var title = LocalizedStringResource("Cancel a temporary Preset", table: "ShortcutsDetail") + static var title = LocalizedStringResource("Cancel a Temporary Target", table: "ShortcutsDetail") // Description of the action in the Shortcuts app - static var description = IntentDescription(.init("Cancel temporary preset", table: "ShortcutsDetail")) + static var description = IntentDescription(.init("Cancel Temporary Target", table: "ShortcutsDetail")) internal var intentRequest: TempPresetsIntentRequest diff --git a/FreeAPS/Sources/Shortcuts/TempPresets/CreateAndApplyTempTarget.swift b/FreeAPS/Sources/Shortcuts/TempPresets/CreateAndApplyTempTarget.swift index 8a933d3513..33e5064fb4 100644 --- a/FreeAPS/Sources/Shortcuts/TempPresets/CreateAndApplyTempTarget.swift +++ b/FreeAPS/Sources/Shortcuts/TempPresets/CreateAndApplyTempTarget.swift @@ -52,12 +52,12 @@ import Foundation static var parameterSummary: some ParameterSummary { When(\.$confirmBeforeApplying, .equalTo, true, { - Summary("Start \(\.$target) \(\.$unit) target during \(\.$duration) min", table: "ShortcutsDetail") { + Summary("Start \(\.$target) \(\.$unit) target for \(\.$duration) min", table: "ShortcutsDetail") { \.$dateStart \.$confirmBeforeApplying } }, otherwise: { - Summary("Start \(\.$target) \(\.$unit) target during \(\.$duration) min", table: "ShortcutsDetail") { + Summary("Start \(\.$target) \(\.$unit) target for \(\.$duration) min", table: "ShortcutsDetail") { \.$dateStart } }) diff --git a/FreeAPS/Sources/Shortcuts/TempPresets/TempPresetsIntentRequest.swift b/FreeAPS/Sources/Shortcuts/TempPresets/TempPresetsIntentRequest.swift index 3257e39751..cc657889e4 100644 --- a/FreeAPS/Sources/Shortcuts/TempPresets/TempPresetsIntentRequest.swift +++ b/FreeAPS/Sources/Shortcuts/TempPresets/TempPresetsIntentRequest.swift @@ -88,7 +88,7 @@ import Foundation var glucoseUnit: GlucoseUnits if let unit = unit { switch unit { - case .mgL: + case .mgdL: glucoseUnit = .mgdL case .mmolL: glucoseUnit = .mmolL diff --git a/FreeAPS/Sources/Shortcuts/TempPresets/UnitIntent.swift b/FreeAPS/Sources/Shortcuts/TempPresets/UnitIntent.swift index b1697e1b39..39b016bec3 100644 --- a/FreeAPS/Sources/Shortcuts/TempPresets/UnitIntent.swift +++ b/FreeAPS/Sources/Shortcuts/TempPresets/UnitIntent.swift @@ -6,14 +6,14 @@ import Foundation static let title = LocalizedStringResource("Unit", table: "ShortcutsDetail") // static var defaultQuery = UnitQuery() - case mgL + case mgdL case mmolL static var typeDisplayRepresentation = TypeDisplayRepresentation(name: .init("Unit", table: "ShortcutsDetail")) static var caseDisplayRepresentations: [Self: DisplayRepresentation] = [ - .mgL: .init(title: LocalizedStringResource("mg/L", table: "ShortcutsDetail")), + .mgdL: .init(title: LocalizedStringResource("mg/dL", table: "ShortcutsDetail")), .mmolL: .init(title: LocalizedStringResource("mmol/L", table: "ShortcutsDetail")) ] } From 7cf46f9ec0ed711b0d617c3281f68ac8bd471ebf Mon Sep 17 00:00:00 2001 From: Robert Date: Sun, 5 May 2024 10:51:40 +0200 Subject: [PATCH 2/2] harmonize short cut names and descriptions --- .../ShortcutsDetail/ShortcutsDetail.xcstrings | 61 +++++++++++++++++-- FreeAPS/Sources/Shortcuts/AppShortcuts.swift | 35 ++++++----- .../Shortcuts/Bolus/BolusShortcut.swift | 6 +- .../Carbs/AddCarbsPresetIntent.swift | 6 +- .../Carbs/ListCarbsPresetIntent.swift | 2 +- .../Overrides/OverrideShortcuts.swift | 10 +-- .../TempPresets/ApplyTempPresetIntent.swift | 10 +-- .../TempPresets/CancelTempPresetIntent.swift | 6 +- .../CreateAndApplyTempTarget.swift | 24 ++++---- .../TempPresets/ListTempPresetsIntent.swift | 6 +- .../TempPresets/tempPresetEntity.swift | 2 +- 11 files changed, 114 insertions(+), 54 deletions(-) diff --git a/FreeAPS/Sources/Localizations/ShortcutsDetail/ShortcutsDetail.xcstrings b/FreeAPS/Sources/Localizations/ShortcutsDetail/ShortcutsDetail.xcstrings index bf302ad7cb..9ca17bd6ba 100644 --- a/FreeAPS/Sources/Localizations/ShortcutsDetail/ShortcutsDetail.xcstrings +++ b/FreeAPS/Sources/Localizations/ShortcutsDetail/ShortcutsDetail.xcstrings @@ -136,8 +136,12 @@ } } } + }, + "Activate an existing TempTarget Preset" : { + }, "Add carbs" : { + "extractionState" : "stale", "localizations" : { "de" : { "stringUnit" : { @@ -176,6 +180,9 @@ } } } + }, + "Add Carbs" : { + }, "Allow to add carbs" : { "localizations" : { @@ -259,6 +266,7 @@ } }, "Allow to list and choose a specific temporary targets" : { + "extractionState" : "stale", "localizations" : { "fr" : { "stringUnit" : { @@ -390,6 +398,7 @@ } }, "Apply a temporary target" : { + "extractionState" : "stale", "localizations" : { "de" : { "stringUnit" : { @@ -428,6 +437,9 @@ } } } + }, + "Apply TempTarget Preset" : { + }, "Applying ${carbQuantity} g at ${dateAdded}" : { "extractionState" : "manual", @@ -679,7 +691,10 @@ } } }, - "Cancel a Temporary Target" : { + "Cancel active TempTarget" : { + + }, + "Cancel an active TempTarget" : { }, "Cancel temporary preset" : { @@ -722,9 +737,6 @@ } } } - }, - "Cancel Temporary Target" : { - }, "carbs" : { "localizations" : { @@ -939,6 +951,7 @@ } }, "Confirm to apply temporary target '%@'" : { + "extractionState" : "stale", "localizations" : { "de" : { "stringUnit" : { @@ -977,6 +990,9 @@ } } } + }, + "Confirm to apply TempTarget '%@'" : { + }, "Create and apply a temporary target" : { "extractionState" : "manual", @@ -1018,6 +1034,12 @@ } } } + }, + "Create and apply a TempTarget" : { + + }, + "Create and apply TempTarget" : { + }, "Date" : { "extractionState" : "manual", @@ -1181,6 +1203,9 @@ } } } + }, + "Duration of the TempTarget" : { + }, "Enable a temporary override" : { "extractionState" : "stale", @@ -1224,6 +1249,7 @@ } }, "Enable a temporary target" : { + "extractionState" : "stale", "localizations" : { "de" : { "stringUnit" : { @@ -1302,6 +1328,12 @@ } } } + }, + "Glucose Target" : { + + }, + "Glucose target in the current unit" : { + }, "Glucose unit" : { "extractionState" : "manual", @@ -1547,8 +1579,12 @@ } } } + }, + "List Carb Presets" : { + }, "List Carbs presets" : { + "extractionState" : "stale", "localizations" : { "de" : { "stringUnit" : { @@ -1670,6 +1706,7 @@ } }, "List Temporary Targets" : { + "extractionState" : "stale", "localizations" : { "fr" : { "stringUnit" : { @@ -1678,6 +1715,9 @@ } } } + }, + "List TempTarget Presets" : { + }, "mg/dL" : { @@ -2265,6 +2305,9 @@ } } } + }, + "Show list and choose an existing TempTarget Preset" : { + }, "Start ${target} ${unit} target for ${duration} min" : { "extractionState" : "manual", @@ -2660,6 +2703,7 @@ } }, "Temporary Target canceled" : { + "extractionState" : "stale", "localizations" : { "de" : { "stringUnit" : { @@ -2739,6 +2783,9 @@ } } } + }, + "TempTarget canceled" : { + }, "Unable to start the temp target" : { "localizations" : { @@ -2861,6 +2908,12 @@ } } } + }, + "What is the duration of TempTarget ?" : { + + }, + "What is the glucose target in the current unit ?" : { + }, "What is the quantity of the carb to add ?" : { "localizations" : { diff --git a/FreeAPS/Sources/Shortcuts/AppShortcuts.swift b/FreeAPS/Sources/Shortcuts/AppShortcuts.swift index 4b4b5df553..e96b63e4b4 100644 --- a/FreeAPS/Sources/Shortcuts/AppShortcuts.swift +++ b/FreeAPS/Sources/Shortcuts/AppShortcuts.swift @@ -6,36 +6,43 @@ import Foundation AppShortcut( intent: ApplyTempPresetIntent(), phrases: [ - "Activate \(.applicationName) temporary target", - "\(.applicationName) apply a temporary target" + "Activate \(.applicationName) TemTarget Preset", + "Activates an available \(.applicationName) temporary target preset" ] ) AppShortcut( - intent: ListStateIntent(), + intent: CreateAndApplyTempTarget(), phrases: [ - "List \(.applicationName) state", - "\(.applicationName) state" + "New \(.applicationName) TempTarget", + "Creates and applies a newly configured \(.applicationName) temporary target" ] ) AppShortcut( - intent: AddCarbPresentIntent(), + intent: CancelTempPresetIntent(), phrases: [ - "Add carbs in \(.applicationName)", - "\(.applicationName) allows to add carbs" + "Cancel \(.applicationName) TempTarget", + "Cancels an active \(.applicationName) TempTarget" ] ) AppShortcut( - intent: CreateAndApplyTempTarget(), + intent: ListStateIntent(), + phrases: [ + "List \(.applicationName) state", + "Lists different states of \(.applicationName)" + ] + ) + AppShortcut( + intent: AddCarbPresentIntent(), phrases: [ - "Create and apply a temporary target in \(.applicationName)", - "\(.applicationName) allows to create and apply a temporary target" + "\(.applicationName) Carbs", + "Adds carbs to \(.applicationName)" ] ) AppShortcut( intent: ApplyOverrideIntent(), phrases: [ - "Activate an \(.applicationName) Override Preset", - "Activates an \(.applicationName) Override Preset" + "Activate \(.applicationName) Override Preset", + "Activates an available \(.applicationName) Override Preset" ] ) AppShortcut( @@ -49,7 +56,7 @@ import Foundation intent: BolusIntent(), phrases: [ "\(.applicationName) Bolus", - "\(.applicationName) Enacts a bolus" + "Enacts a new \(.applicationName) bolus" ] ) } diff --git a/FreeAPS/Sources/Shortcuts/Bolus/BolusShortcut.swift b/FreeAPS/Sources/Shortcuts/Bolus/BolusShortcut.swift index 10db71f734..5240cb8e33 100644 --- a/FreeAPS/Sources/Shortcuts/Bolus/BolusShortcut.swift +++ b/FreeAPS/Sources/Shortcuts/Bolus/BolusShortcut.swift @@ -3,7 +3,7 @@ import Foundation import Intents @available(iOS 16.0,*) struct BolusIntent: AppIntent { - static var title: LocalizedStringResource = "Bolus" + static var title: LocalizedStringResource = "Enact Bolus" static var description = IntentDescription("Allow to send a bolus command to iAPS.") @Parameter( @@ -22,11 +22,11 @@ import Intents static var parameterSummary: some ParameterSummary { When(\.$confirmBeforeApplying, .equalTo, true, { - Summary("Applying \(\.$bolusQuantity)") { + Summary("Enacting \(\.$bolusQuantity)") { \.$confirmBeforeApplying } }, otherwise: { - Summary("Immediately applying \(\.$bolusQuantity)") { + Summary("Immediately enacting \(\.$bolusQuantity)") { \.$confirmBeforeApplying } }) diff --git a/FreeAPS/Sources/Shortcuts/Carbs/AddCarbsPresetIntent.swift b/FreeAPS/Sources/Shortcuts/Carbs/AddCarbsPresetIntent.swift index 2c14497be8..38c32d803c 100644 --- a/FreeAPS/Sources/Shortcuts/Carbs/AddCarbsPresetIntent.swift +++ b/FreeAPS/Sources/Shortcuts/Carbs/AddCarbsPresetIntent.swift @@ -5,7 +5,7 @@ import Swinject @available(iOS 16.0,*) struct AddCarbPresentIntent: AppIntent { // Title of the action in the Shortcuts app - static var title = LocalizedStringResource("Add carbs", table: "ShortcutsDetail") + static var title = LocalizedStringResource("Add Carbs", table: "ShortcutsDetail") // Description of the action in the Shortcuts app static var description = IntentDescription(.init("Allow to add carbs", table: "ShortcutsDetail")) @@ -55,13 +55,13 @@ import Swinject static var parameterSummary: some ParameterSummary { When(\.$confirmBeforeApplying, .equalTo, true, { - Summary("Applying \(\.$carbQuantity) g at \(\.$dateAdded)", table: "ShortcutsDetail") { + Summary("Adding \(\.$carbQuantity) g at \(\.$dateAdded)", table: "ShortcutsDetail") { \.$fatQuantity \.$proteinQuantity \.$confirmBeforeApplying } }, otherwise: { - Summary("Immediately applying \(\.$carbQuantity) g at \(\.$dateAdded)", table: "ShortcutsDetail") { + Summary("Immediately adding \(\.$carbQuantity) g at \(\.$dateAdded)", table: "ShortcutsDetail") { \.$fatQuantity \.$proteinQuantity \.$confirmBeforeApplying diff --git a/FreeAPS/Sources/Shortcuts/Carbs/ListCarbsPresetIntent.swift b/FreeAPS/Sources/Shortcuts/Carbs/ListCarbsPresetIntent.swift index 0f19465527..712d1121a5 100644 --- a/FreeAPS/Sources/Shortcuts/Carbs/ListCarbsPresetIntent.swift +++ b/FreeAPS/Sources/Shortcuts/Carbs/ListCarbsPresetIntent.swift @@ -3,7 +3,7 @@ import Foundation @available(iOS 16.0, *) struct ListCarbsPresetsIntent: AppIntent { // Title of the action in the Shortcuts app - static var title = LocalizedStringResource("List Carbs presets", table: "ShortcutsDetail") + static var title = LocalizedStringResource("List Carb Presets", table: "ShortcutsDetail") // Description of the action in the Shortcuts app static var description = IntentDescription( diff --git a/FreeAPS/Sources/Shortcuts/Overrides/OverrideShortcuts.swift b/FreeAPS/Sources/Shortcuts/Overrides/OverrideShortcuts.swift index 3ac741696f..27dd5fca0e 100644 --- a/FreeAPS/Sources/Shortcuts/Overrides/OverrideShortcuts.swift +++ b/FreeAPS/Sources/Shortcuts/Overrides/OverrideShortcuts.swift @@ -23,7 +23,7 @@ enum OverrideIntentError: Error { @available(iOS 16.0, *) struct ApplyOverrideIntent: AppIntent { // Title of the action in the Shortcuts app - static var title: LocalizedStringResource = "Activate an Override Preset" + static var title: LocalizedStringResource = "Activate Override Preset" // Description of the action in the Shortcuts app static var description = IntentDescription("Allow to activate an overrride preset.") @@ -44,11 +44,11 @@ enum OverrideIntentError: Error { static var parameterSummary: some ParameterSummary { When(\ApplyOverrideIntent.$confirmBeforeApplying, .equalTo, true, { - Summary("Applying \(\.$preset)") { + Summary("Activating \(\.$preset)") { \.$confirmBeforeApplying } }, otherwise: { - Summary("Immediately applying \(\.$preset)") { + Summary("Immediately activating \(\.$preset)") { \.$confirmBeforeApplying } }) @@ -90,8 +90,8 @@ enum OverrideIntentError: Error { } @available(iOS 16.0, *) struct CancelOverrideIntent: AppIntent { - static var title: LocalizedStringResource = "Cancel active override" - static var description = IntentDescription("Cancel active override.") + static var title: LocalizedStringResource = "Cancel active Override" + static var description = IntentDescription("Cancel active Override.") internal var intentRequest: OverrideIntentRequest diff --git a/FreeAPS/Sources/Shortcuts/TempPresets/ApplyTempPresetIntent.swift b/FreeAPS/Sources/Shortcuts/TempPresets/ApplyTempPresetIntent.swift index 6859a2ccf1..907a6659ee 100644 --- a/FreeAPS/Sources/Shortcuts/TempPresets/ApplyTempPresetIntent.swift +++ b/FreeAPS/Sources/Shortcuts/TempPresets/ApplyTempPresetIntent.swift @@ -3,10 +3,10 @@ import Foundation @available(iOS 16.0, *) struct ApplyTempPresetIntent: AppIntent { // Title of the action in the Shortcuts app - static var title = LocalizedStringResource("Apply a temporary target", table: "ShortcutsDetail") + static var title = LocalizedStringResource("Activate TempTarget Preset", table: "ShortcutsDetail") // Description of the action in the Shortcuts app - static var description = IntentDescription(.init("Enable a temporary target", table: "ShortcutsDetail")) + static var description = IntentDescription(.init("Activate an existing TempTarget Preset", table: "ShortcutsDetail")) internal var intentRequest: TempPresetsIntentRequest @@ -27,11 +27,11 @@ import Foundation static var parameterSummary: some ParameterSummary { When(\ApplyTempPresetIntent.$confirmBeforeApplying, .equalTo, true, { - Summary("Applying \(\.$preset)", table: "ShortcutsDetail") { + Summary("Activiating \(\.$preset)", table: "ShortcutsDetail") { \.$confirmBeforeApplying } }, otherwise: { - Summary("Immediately applying \(\.$preset)", table: "ShortcutsDetail") {} + Summary("Immediately activating \(\.$preset)", table: "ShortcutsDetail") {} }) } @@ -62,7 +62,7 @@ import Foundation try await requestConfirmation( result: .result( dialog: IntentDialog(LocalizedStringResource( - "Confirm to apply temporary target '\(displayName)'", + "Confirm to apply TempTarget '\(displayName)'", table: "ShortcutsDetail" )) ) diff --git a/FreeAPS/Sources/Shortcuts/TempPresets/CancelTempPresetIntent.swift b/FreeAPS/Sources/Shortcuts/TempPresets/CancelTempPresetIntent.swift index 10dcdfd66d..82e7be6672 100644 --- a/FreeAPS/Sources/Shortcuts/TempPresets/CancelTempPresetIntent.swift +++ b/FreeAPS/Sources/Shortcuts/TempPresets/CancelTempPresetIntent.swift @@ -3,10 +3,10 @@ import Foundation @available(iOS 16.0, *) struct CancelTempPresetIntent: AppIntent { // Title of the action in the Shortcuts app - static var title = LocalizedStringResource("Cancel a Temporary Target", table: "ShortcutsDetail") + static var title = LocalizedStringResource("Cancel active TempTarget", table: "ShortcutsDetail") // Description of the action in the Shortcuts app - static var description = IntentDescription(.init("Cancel Temporary Target", table: "ShortcutsDetail")) + static var description = IntentDescription(.init("Cancel an active TempTarget", table: "ShortcutsDetail")) internal var intentRequest: TempPresetsIntentRequest @@ -18,7 +18,7 @@ import Foundation do { try intentRequest.cancelTempTarget() return .result( - dialog: IntentDialog(LocalizedStringResource("Temporary Target canceled", table: "ShortcutsDetail")) + dialog: IntentDialog(LocalizedStringResource("TempTarget canceled", table: "ShortcutsDetail")) ) } catch { throw error diff --git a/FreeAPS/Sources/Shortcuts/TempPresets/CreateAndApplyTempTarget.swift b/FreeAPS/Sources/Shortcuts/TempPresets/CreateAndApplyTempTarget.swift index 33e5064fb4..ff494edcc4 100644 --- a/FreeAPS/Sources/Shortcuts/TempPresets/CreateAndApplyTempTarget.swift +++ b/FreeAPS/Sources/Shortcuts/TempPresets/CreateAndApplyTempTarget.swift @@ -3,10 +3,10 @@ import Foundation @available(iOS 16.0, *) struct CreateAndApplyTempTarget: AppIntent { // Title of the action in the Shortcuts app - static var title = LocalizedStringResource("Create and apply a temporary target", table: "ShortcutsDetail") + static var title = LocalizedStringResource("Create and apply TempTarget", table: "ShortcutsDetail") // Description of the action in the Shortcuts app - static var description: IntentDescription = .init(.init("Create and apply a temporary target", table: "ShortcutsDetail")) + static var description: IntentDescription = .init(.init("Create and apply a TempTarget", table: "ShortcutsDetail")) internal var intentRequest: TempPresetsIntentRequest @@ -20,11 +20,11 @@ import Foundation ) var dateStart: Date? @Parameter( - title: LocalizedStringResource("Temporary Target", table: "ShortcutsDetail"), - description: LocalizedStringResource("Temporary target in the current unit", table: "ShortcutsDetail"), + title: LocalizedStringResource("Glucose Target", table: "ShortcutsDetail"), + description: LocalizedStringResource("Glucose target in the current unit", table: "ShortcutsDetail"), controlStyle: .field, requestValueDialog: IntentDialog(LocalizedStringResource( - "What is the temporary target in the current unit ?", + "What is the glucose target in the current unit?", table: "ShortcutsDetail" )) ) var target: Double @@ -36,10 +36,10 @@ import Foundation @Parameter( title: LocalizedStringResource("duration", table: "ShortcutsDetail"), - description: LocalizedStringResource("Duration of the temporary target", table: "ShortcutsDetail"), + description: LocalizedStringResource("Duration of the TempTarget", table: "ShortcutsDetail"), controlStyle: .field, requestValueDialog: IntentDialog(LocalizedStringResource( - "What is the duration of temporary target ?", + "What is the duration for the TempTarget?", table: "ShortcutsDetail" )) ) var duration: Double @@ -52,12 +52,12 @@ import Foundation static var parameterSummary: some ParameterSummary { When(\.$confirmBeforeApplying, .equalTo, true, { - Summary("Start \(\.$target) \(\.$unit) target for \(\.$duration) min", table: "ShortcutsDetail") { + Summary("Starting \(\.$target) \(\.$unit) TempTarget for \(\.$duration) min", table: "ShortcutsDetail") { \.$dateStart \.$confirmBeforeApplying } }, otherwise: { - Summary("Start \(\.$target) \(\.$unit) target for \(\.$duration) min", table: "ShortcutsDetail") { + Summary("Immediatly starting \(\.$target) \(\.$unit) TempTarget for \(\.$duration) min", table: "ShortcutsDetail") { \.$dateStart } }) @@ -106,7 +106,7 @@ import Foundation result: .result( dialog: IntentDialog( LocalizedStringResource( - "Are you sure to create a temporay target with \(targetChoiceName) \(unitName) during \(durationChoiceName) min at \(dateChoiceName) ?", + "Are you sure to create a TempTarget with \(targetChoiceName) \(unitName) for \(durationChoiceName) min at \(dateChoiceName) ?", table: "ShortcutsDetail" ) ) @@ -122,11 +122,11 @@ import Foundation ) { let formattedTime = decimalToTimeFormattedString(decimal: finalTempTargetApply.duration) return .result( - dialog: IntentDialog(LocalizedStringResource("Target applied for \(formattedTime)", table: "ShortcutsDetail")) + dialog: IntentDialog(LocalizedStringResource("TempTarget activated for \(formattedTime)", table: "ShortcutsDetail")) ) } else { return .result( - dialog: IntentDialog(LocalizedStringResource("Unable to start the temp target", table: "ShortcutsDetail")) + dialog: IntentDialog(LocalizedStringResource("Unable to start the TempTarget", table: "ShortcutsDetail")) ) } diff --git a/FreeAPS/Sources/Shortcuts/TempPresets/ListTempPresetsIntent.swift b/FreeAPS/Sources/Shortcuts/TempPresets/ListTempPresetsIntent.swift index 9745958cb6..1f4e900514 100644 --- a/FreeAPS/Sources/Shortcuts/TempPresets/ListTempPresetsIntent.swift +++ b/FreeAPS/Sources/Shortcuts/TempPresets/ListTempPresetsIntent.swift @@ -3,12 +3,12 @@ import Foundation @available(iOS 16.0, *) struct ListTempPresetsIntent: AppIntent { // Title of the action in the Shortcuts app - static var title = LocalizedStringResource("List Temporary Targets", table: "ShortcutsDetail") + static var title = LocalizedStringResource("List TempTarget Presets", table: "ShortcutsDetail") // Description of the action in the Shortcuts app static var description = IntentDescription( .init( - "Allow to list and choose a specific temporary targets", + "Show list and choose an existing TempTarget Preset", table: "ShortcutsDetail" ) ) @@ -19,7 +19,7 @@ import Foundation ) var preset: tempPreset? static var parameterSummary: some ParameterSummary { - Summary("Choose the temporary target \(\.$preset)", table: "ShortcutsDetail") + Summary("Choose the TempTarget \(\.$preset)", table: "ShortcutsDetail") } @MainActor func perform() async throws -> some ReturnsValue { diff --git a/FreeAPS/Sources/Shortcuts/TempPresets/tempPresetEntity.swift b/FreeAPS/Sources/Shortcuts/TempPresets/tempPresetEntity.swift index bda7d307ec..1554d0c289 100644 --- a/FreeAPS/Sources/Shortcuts/TempPresets/tempPresetEntity.swift +++ b/FreeAPS/Sources/Shortcuts/TempPresets/tempPresetEntity.swift @@ -16,7 +16,7 @@ import Swinject DisplayRepresentation(title: "\(name)") } - static var typeDisplayRepresentation: TypeDisplayRepresentation = "Temporary Target" + static var typeDisplayRepresentation: TypeDisplayRepresentation = "TempTarget" static func convert(_ tempTarget: TempTarget) -> tempPreset { var tp = tempPreset(