diff --git a/FreeAPS/Sources/Localizations/Main/ar.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/ar.lproj/Localizable.strings index ac08d900f..7bb337bfb 100644 --- a/FreeAPS/Sources/Localizations/Main/ar.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/ar.lproj/Localizable.strings @@ -1035,7 +1035,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "To prevent LOW required %d g of carbs"; /* */ -"iAPS not active" = "iAPS not active"; +"Open-iAPS Not Active" = "Open-iAPS Not Active"; /* */ "Last loop was more than %d min ago" = "Last loop was more than %d min ago"; diff --git a/FreeAPS/Sources/Localizations/Main/ca.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/ca.lproj/Localizable.strings index f41e0bf13..d0c15b71e 100644 --- a/FreeAPS/Sources/Localizations/Main/ca.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/ca.lproj/Localizable.strings @@ -940,7 +940,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "To prevent LOW required %d g of carbs"; /* */ -"iAPS not active" = "iAPS not active"; +"Open-iAPS Not Active" = "Open-iAPS Not Active"; /* */ "Last loop was more than %d min ago" = "Last loop was more than %d min ago"; diff --git a/FreeAPS/Sources/Localizations/Main/da.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/da.lproj/Localizable.strings index e16abf799..2903af879 100644 --- a/FreeAPS/Sources/Localizations/Main/da.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/da.lproj/Localizable.strings @@ -1035,7 +1035,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "To prevent LOW required %d g of carbs"; /* */ -"iAPS not active" = "iAPS not active"; +"Open-iAPS Not Active" = "Open-iAPS Not Active"; /* */ "Last loop was more than %d min ago" = "Last loop was more than %d min ago"; diff --git a/FreeAPS/Sources/Localizations/Main/de.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/de.lproj/Localizable.strings index 0fdbe33e9..66a9cafaa 100644 --- a/FreeAPS/Sources/Localizations/Main/de.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/de.lproj/Localizable.strings @@ -1038,7 +1038,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "Um einen NIEDRIGEN BZ zu verhindern, werden %d g Kohlenhydrate benötigt"; /* */ -"iAPS not active" = "iAPS ist nicht aktiv"; +"Open-iAPS Not Active" = "Open-iAPS ist nicht aktiv"; /* */ "Last loop was more than %d min ago" = "Letzter Loop vor mehr als %d Minuten"; diff --git a/FreeAPS/Sources/Localizations/Main/en.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/en.lproj/Localizable.strings index af09f7d3b..afb92d71e 100644 --- a/FreeAPS/Sources/Localizations/Main/en.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/en.lproj/Localizable.strings @@ -1035,7 +1035,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "To prevent LOW required %d g of carbs"; /* */ - "iAPS not active" = "iAPS not active"; + "Open-iAPS Not Active" = "Open-iAPS Not Active"; /* */ "Last loop was more than %d min ago" = "Last loop was more than %d min ago"; diff --git a/FreeAPS/Sources/Localizations/Main/es.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/es.lproj/Localizable.strings index db2be06a4..f59940eee 100644 --- a/FreeAPS/Sources/Localizations/Main/es.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/es.lproj/Localizable.strings @@ -1034,7 +1034,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "To prevent LOW required %d g of carbs"; /* */ -"iAPS not active" = "iAPS not active"; +"Open-iAPS Not Active" = "Open-iAPS Not Active"; /* */ "Last loop was more than %d min ago" = "Last loop was more than %d min ago"; diff --git a/FreeAPS/Sources/Localizations/Main/fi.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/fi.lproj/Localizable.strings index 6e71733cd..288fcd0c7 100644 --- a/FreeAPS/Sources/Localizations/Main/fi.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/fi.lproj/Localizable.strings @@ -1035,7 +1035,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "To prevent LOW required %d g of carbs"; /* */ -"iAPS not active" = "iAPS not active"; +"Open-iAPS Not Active" = "Open-iAPS Not Active"; /* */ "Last loop was more than %d min ago" = "Last loop was more than %d min ago"; diff --git a/FreeAPS/Sources/Localizations/Main/fr.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/fr.lproj/Localizable.strings index 292c0b8cc..ba5183043 100644 --- a/FreeAPS/Sources/Localizations/Main/fr.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/fr.lproj/Localizable.strings @@ -1035,7 +1035,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "Pour éviter BAS %d g de glucides requis"; /* */ -"iAPS not active" = "iAPS pas actif"; +"Open-iAPS Not Active" = "Open-iAPS pas actif"; /* */ "Last loop was more than %d min ago" = "Dernier bouclage depuis plus de %d min"; diff --git a/FreeAPS/Sources/Localizations/Main/he.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/he.lproj/Localizable.strings index ac08d900f..7bb337bfb 100644 --- a/FreeAPS/Sources/Localizations/Main/he.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/he.lproj/Localizable.strings @@ -1035,7 +1035,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "To prevent LOW required %d g of carbs"; /* */ -"iAPS not active" = "iAPS not active"; +"Open-iAPS Not Active" = "Open-iAPS Not Active"; /* */ "Last loop was more than %d min ago" = "Last loop was more than %d min ago"; diff --git a/FreeAPS/Sources/Localizations/Main/hu.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/hu.lproj/Localizable.strings index 5ae84f420..fcdc73ad6 100644 --- a/FreeAPS/Sources/Localizations/Main/hu.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/hu.lproj/Localizable.strings @@ -1035,7 +1035,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "To prevent LOW required %d g of carbs"; /* */ -"iAPS not active" = "iAPS not active"; +"Open-iAPS Not Active" = "Open-iAPS Not Active"; /* */ "Last loop was more than %d min ago" = "Last loop was more than %d min ago"; diff --git a/FreeAPS/Sources/Localizations/Main/it.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/it.lproj/Localizable.strings index c45d54136..cca24d5c4 100644 --- a/FreeAPS/Sources/Localizations/Main/it.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/it.lproj/Localizable.strings @@ -1035,7 +1035,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "Per evitare glicemia BASSA servono %d g di carboidrati"; /* */ -"iAPS not active" = "iAPS non attivo"; +"Open-iAPS Not Active" = "Open-iAPS non attivo"; /* */ "Last loop was more than %d min ago" = "L'ultimo ciclo è stato più di %d min fa"; diff --git a/FreeAPS/Sources/Localizations/Main/nb.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/nb.lproj/Localizable.strings index e7806646e..aa5da37c1 100644 --- a/FreeAPS/Sources/Localizations/Main/nb.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/nb.lproj/Localizable.strings @@ -1035,7 +1035,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "For å forhindre lavt blodsukker: %d g karbo nødvendig"; /* */ -"iAPS not active" = "iAPS ikke aktiv"; +"Open-iAPS Not Active" = "Open-iAPS ikke aktiv"; /* */ "Last loop was more than %d min ago" = "Siste loop var mer enn %d min siden"; diff --git a/FreeAPS/Sources/Localizations/Main/nl.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/nl.lproj/Localizable.strings index c3c670208..bbafab7bf 100644 --- a/FreeAPS/Sources/Localizations/Main/nl.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/nl.lproj/Localizable.strings @@ -1035,7 +1035,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "Om LAAG te voorkomen zijn %d g koolhydraten nodig"; /* */ -"iAPS not active" = "iAPS is niet actief!"; +"Open-iAPS Not Active" = "Open-iAPS is niet actief!"; /* */ "Last loop was more than %d min ago" = "Laatste loop was meer dan %d min geleden"; diff --git a/FreeAPS/Sources/Localizations/Main/pl.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/pl.lproj/Localizable.strings index 1cffbbdc8..7fd88b15b 100644 --- a/FreeAPS/Sources/Localizations/Main/pl.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/pl.lproj/Localizable.strings @@ -1037,7 +1037,7 @@ Połączono z Nightscout!"; "To prevent LOW required %d g of carbs" = "To prevent LOW required %d g of carbs"; /* */ -"iAPS not active" = "iAPS not active"; +"Open-iAPS Not Active" = "Open-iAPS Not Active"; /* */ "Last loop was more than %d min ago" = "Last loop was more than %d min ago"; diff --git a/FreeAPS/Sources/Localizations/Main/pt-BR.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/pt-BR.lproj/Localizable.strings index 9024c9f83..01f7ef162 100644 --- a/FreeAPS/Sources/Localizations/Main/pt-BR.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/pt-BR.lproj/Localizable.strings @@ -1035,7 +1035,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "To prevent LOW required %d g of carbs"; /* */ -"iAPS not active" = "iAPS not active"; +"Open-iAPS Not Active" = "Open-iAPS Not Active"; /* */ "Last loop was more than %d min ago" = "Last loop was more than %d min ago"; diff --git a/FreeAPS/Sources/Localizations/Main/pt-PT.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/pt-PT.lproj/Localizable.strings index 95d06e538..80cc692c6 100644 --- a/FreeAPS/Sources/Localizations/Main/pt-PT.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/pt-PT.lproj/Localizable.strings @@ -1035,7 +1035,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "To prevent LOW required %d g of carbs"; /* */ -"iAPS not active" = "iAPS not active"; +"Open-iAPS Not Active" = "Open-iAPS Not Active"; /* */ "Last loop was more than %d min ago" = "Last loop was more than %d min ago"; diff --git a/FreeAPS/Sources/Localizations/Main/ru.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/ru.lproj/Localizable.strings index 0b761562b..0211937f6 100644 --- a/FreeAPS/Sources/Localizations/Main/ru.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/ru.lproj/Localizable.strings @@ -1038,7 +1038,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "Для избежания ГИПО необходимо %d г углеводов"; /* */ -"iAPS not active" = "iAPS неактивен"; +"Open-iAPS Not Active" = "Open-iAPS неактивен"; /* */ "Last loop was more than %d min ago" = "Последний цикл был более %d минут назад"; diff --git a/FreeAPS/Sources/Localizations/Main/sk.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/sk.lproj/Localizable.strings index 069756d72..b7b184cb5 100644 --- a/FreeAPS/Sources/Localizations/Main/sk.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/sk.lproj/Localizable.strings @@ -1035,7 +1035,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "Na zabránenie NÍZKY potrebných %d g sacharidov"; /* */ -"iAPS not active" = "iAPS nie je aktívny"; +"Open-iAPS Not Active" = "Open-iAPS nie je aktívny"; /* */ "Last loop was more than %d min ago" = "Posledná slučka bola pred viac ako %d min"; diff --git a/FreeAPS/Sources/Localizations/Main/sv.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/sv.lproj/Localizable.strings index c78316c2b..37e1ec1ab 100644 --- a/FreeAPS/Sources/Localizations/Main/sv.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/sv.lproj/Localizable.strings @@ -1035,7 +1035,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "För att förhindra ett lågt blodsocker krävs uppskattningsvis %d g kolhydrater"; /* */ -"iAPS not active" = "iAPS är inte aktiv"; +"Open-iAPS Not Active" = "Open-iAPS är inte aktiv"; /* */ "Last loop was more than %d min ago" = "Senaste loop var för mer än %d min sedan"; diff --git a/FreeAPS/Sources/Localizations/Main/tr.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/tr.lproj/Localizable.strings index dc27cb8d7..024edcb28 100644 --- a/FreeAPS/Sources/Localizations/Main/tr.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/tr.lproj/Localizable.strings @@ -1039,7 +1039,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "DÜŞÜK KŞ'ini önlemek için gerekli Karbonhidrat %d g"; /* */ -"iAPS not active" = "iAPS etkin değil"; +"Open-iAPS Not Active" = "Open-iAPS etkin değil"; /* */ "Last loop was more than %d min ago" = "Son döngü %d dak kadar önceydi"; diff --git a/FreeAPS/Sources/Localizations/Main/uk.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/uk.lproj/Localizable.strings index 3940af1ab..9745a8124 100644 --- a/FreeAPS/Sources/Localizations/Main/uk.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/uk.lproj/Localizable.strings @@ -1035,7 +1035,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "Для запобігання ГІПО потрібно %d g вуглеводів"; /* */ -"iAPS not active" = "iAPS не активний"; +"Open-iAPS Not Active" = "Open-iAPS не активний"; /* */ "Last loop was more than %d min ago" = "Останній цикл був більше, ніж %d хв тому"; diff --git a/FreeAPS/Sources/Localizations/Main/vi.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/vi.lproj/Localizable.strings index 4064653df..c2ad39924 100644 --- a/FreeAPS/Sources/Localizations/Main/vi.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/vi.lproj/Localizable.strings @@ -1035,7 +1035,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "Để hạn chế LOW yêu cầu %d g carbs"; /* */ -"iAPS not active" = "iAPS chưa hoạt động"; +"Open-iAPS Not Active" = "Open-iAPS chưa hoạt động"; /* */ "Last loop was more than %d min ago" = "Loop dừng hoạt động hơn %d phút trước"; diff --git a/FreeAPS/Sources/Localizations/Main/zh-Hans.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/zh-Hans.lproj/Localizable.strings index 2386386b0..27e9d2477 100644 --- a/FreeAPS/Sources/Localizations/Main/zh-Hans.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/zh-Hans.lproj/Localizable.strings @@ -1035,7 +1035,7 @@ Enact a temp Basal or a temp target */ "To prevent LOW required %d g of carbs" = "为了防止低血糖, 需要%d 克碳水"; /* */ -"iAPS not active" = "iAPS 未激活"; +"Open-iAPS Not Active" = "Open-iAPS 未激活"; /* */ "Last loop was more than %d min ago" = "上次闭环成功在 %d 分钟前"; diff --git a/FreeAPS/Sources/Services/UserNotifiactions/UserNotificationsManager.swift b/FreeAPS/Sources/Services/UserNotifiactions/UserNotificationsManager.swift index 16e93c11c..978dfbf0f 100644 --- a/FreeAPS/Sources/Services/UserNotifiactions/UserNotificationsManager.swift +++ b/FreeAPS/Sources/Services/UserNotifiactions/UserNotificationsManager.swift @@ -126,8 +126,8 @@ final class BaseUserNotificationsManager: NSObject, UserNotificationsManager, In private func scheduleMissingLoopNotifiactions(date _: Date) { ensureCanSendNotification { - let title = NSLocalizedString("iAPS not active", comment: "iAPS not active") - let body = NSLocalizedString("Last loop was more then %d min ago", comment: "Last loop was more then %d min ago") + let title = NSLocalizedString("Open-iAPS Not Active", comment: "Open-iAPS Not Active") + let body = NSLocalizedString("Last loop was more than %d min ago", comment: "Last loop was more than %d min ago") let firstInterval = 20 // min let secondInterval = 40 // min diff --git a/FreeAPS/Sources/Shortcuts/State/ListStateIntent.swift b/FreeAPS/Sources/Shortcuts/State/ListStateIntent.swift index 7989cb1a9..29dfef96e 100644 --- a/FreeAPS/Sources/Shortcuts/State/ListStateIntent.swift +++ b/FreeAPS/Sources/Shortcuts/State/ListStateIntent.swift @@ -13,7 +13,7 @@ import Foundation ) static var parameterSummary: some ParameterSummary { - Summary("List all states of iAPS") + Summary("List all states of Open-iAPS") } @MainActor func perform() async throws -> some ReturnsValue & ShowsSnippetView { diff --git a/FreeAPS/Sources/Shortcuts/TempPresets/ApplyTempPresetIntent.swift b/FreeAPS/Sources/Shortcuts/TempPresets/ApplyTempPresetIntent.swift index 1c4e95ecf..791dd56ed 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 Preset" + static var title: LocalizedStringResource = "Apply a temporary target" // Description of the action in the Shortcuts app - static var description = IntentDescription("Allow to apply a specific temporary preset.") + static var description = IntentDescription("Enable a temporary target") internal var intentRequest: TempPresetsIntentRequest @@ -34,6 +34,16 @@ import Foundation }) } + private func decimalToTimeFormattedString(decimal: Decimal) -> String { + let timeInterval = TimeInterval(decimal * 60) // seconds + + let formatter = DateComponentsFormatter() + formatter.allowedUnits = [.hour, .minute] + formatter.unitsStyle = .brief // example: 1h 10 min + + return formatter.string(from: timeInterval) ?? "" + } + @MainActor func perform() async throws -> some ProvidesDialog { do { let presetToApply: tempPreset @@ -42,22 +52,23 @@ import Foundation } else { presetToApply = try await $preset.requestDisambiguation( among: intentRequest.fetchAll(), - dialog: "What temp preset would you like ?" + dialog: "Select Temporary Target" ) } let displayName: String = presetToApply.name if confirmBeforeApplying { try await requestConfirmation( - result: .result(dialog: "Are you sure to applying the temp target \(displayName) ?") + result: .result(dialog: "Confirm to apply temporary target '\(displayName)'") ) } // TODO: enact the temp target let tempTarget = try intentRequest.findTempTarget(presetToApply) let finalTempTargetApply = try intentRequest.enactTempTarget(tempTarget) + let formattedTime = decimalToTimeFormattedString(decimal: finalTempTargetApply.duration) let displayDetail: String = - "the target \(finalTempTargetApply.displayName) is applying during \(finalTempTargetApply.duration) mn" + "Target '\(finalTempTargetApply.displayName)' applied for \(formattedTime)" return .result( dialog: IntentDialog(stringLiteral: displayDetail) )