Skip to content

Commit

Permalink
harmonize short cut names and descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
mountrcg committed May 8, 2024
1 parent 33b6dcf commit 7cf46f9
Show file tree
Hide file tree
Showing 11 changed files with 114 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,12 @@
}
}
}
},
"Activate an existing TempTarget Preset" : {

},
"Add carbs" : {
"extractionState" : "stale",
"localizations" : {
"de" : {
"stringUnit" : {
Expand Down Expand Up @@ -176,6 +180,9 @@
}
}
}
},
"Add Carbs" : {

},
"Allow to add carbs" : {
"localizations" : {
Expand Down Expand Up @@ -259,6 +266,7 @@
}
},
"Allow to list and choose a specific temporary targets" : {
"extractionState" : "stale",
"localizations" : {
"fr" : {
"stringUnit" : {
Expand Down Expand Up @@ -390,6 +398,7 @@
}
},
"Apply a temporary target" : {
"extractionState" : "stale",
"localizations" : {
"de" : {
"stringUnit" : {
Expand Down Expand Up @@ -428,6 +437,9 @@
}
}
}
},
"Apply TempTarget Preset" : {

},
"Applying ${carbQuantity} g at ${dateAdded}" : {
"extractionState" : "manual",
Expand Down Expand Up @@ -679,7 +691,10 @@
}
}
},
"Cancel a Temporary Target" : {
"Cancel active TempTarget" : {

},
"Cancel an active TempTarget" : {

},
"Cancel temporary preset" : {
Expand Down Expand Up @@ -722,9 +737,6 @@
}
}
}
},
"Cancel Temporary Target" : {

},
"carbs" : {
"localizations" : {
Expand Down Expand Up @@ -939,6 +951,7 @@
}
},
"Confirm to apply temporary target '%@'" : {
"extractionState" : "stale",
"localizations" : {
"de" : {
"stringUnit" : {
Expand Down Expand Up @@ -977,6 +990,9 @@
}
}
}
},
"Confirm to apply TempTarget '%@'" : {

},
"Create and apply a temporary target" : {
"extractionState" : "manual",
Expand Down Expand Up @@ -1018,6 +1034,12 @@
}
}
}
},
"Create and apply a TempTarget" : {

},
"Create and apply TempTarget" : {

},
"Date" : {
"extractionState" : "manual",
Expand Down Expand Up @@ -1181,6 +1203,9 @@
}
}
}
},
"Duration of the TempTarget" : {

},
"Enable a temporary override" : {
"extractionState" : "stale",
Expand Down Expand Up @@ -1224,6 +1249,7 @@
}
},
"Enable a temporary target" : {
"extractionState" : "stale",
"localizations" : {
"de" : {
"stringUnit" : {
Expand Down Expand Up @@ -1302,6 +1328,12 @@
}
}
}
},
"Glucose Target" : {

},
"Glucose target in the current unit" : {

},
"Glucose unit" : {
"extractionState" : "manual",
Expand Down Expand Up @@ -1547,8 +1579,12 @@
}
}
}
},
"List Carb Presets" : {

},
"List Carbs presets" : {
"extractionState" : "stale",
"localizations" : {
"de" : {
"stringUnit" : {
Expand Down Expand Up @@ -1670,6 +1706,7 @@
}
},
"List Temporary Targets" : {
"extractionState" : "stale",
"localizations" : {
"fr" : {
"stringUnit" : {
Expand All @@ -1678,6 +1715,9 @@
}
}
}
},
"List TempTarget Presets" : {

},
"mg/dL" : {

Expand Down Expand Up @@ -2265,6 +2305,9 @@
}
}
}
},
"Show list and choose an existing TempTarget Preset" : {

},
"Start ${target} ${unit} target for ${duration} min" : {
"extractionState" : "manual",
Expand Down Expand Up @@ -2660,6 +2703,7 @@
}
},
"Temporary Target canceled" : {
"extractionState" : "stale",
"localizations" : {
"de" : {
"stringUnit" : {
Expand Down Expand Up @@ -2739,6 +2783,9 @@
}
}
}
},
"TempTarget canceled" : {

},
"Unable to start the temp target" : {
"localizations" : {
Expand Down Expand Up @@ -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" : {
Expand Down
35 changes: 21 additions & 14 deletions FreeAPS/Sources/Shortcuts/AppShortcuts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -49,7 +56,7 @@ import Foundation
intent: BolusIntent(),
phrases: [
"\(.applicationName) Bolus",
"\(.applicationName) Enacts a bolus"
"Enacts a new \(.applicationName) bolus"
]
)
}
Expand Down
6 changes: 3 additions & 3 deletions FreeAPS/Sources/Shortcuts/Bolus/BolusShortcut.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
}
})
Expand Down
6 changes: 3 additions & 3 deletions FreeAPS/Sources/Shortcuts/Carbs/AddCarbsPresetIntent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
10 changes: 5 additions & 5 deletions FreeAPS/Sources/Shortcuts/Overrides/OverrideShortcuts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand All @@ -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
}
})
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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") {}
})
}

Expand Down Expand Up @@ -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"
))
)
Expand Down
Loading

0 comments on commit 7cf46f9

Please sign in to comment.