Skip to content

Commit

Permalink
Update strings and sync with dev (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-b-m authored Jun 15, 2023
1 parent f20a46d commit e054547
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 43 deletions.
2 changes: 1 addition & 1 deletion FreeAPS/Resources/javascript/bundle/determine-basal.js

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions FreeAPS/Sources/Localizations/Main/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -1298,8 +1298,11 @@ Enact a temp Basal or a temp target */
/* */
"Insulin Sensitivity" = "Insulin Sensitivity";

/* Formuala displayed in Bolus info pop-up*/
"(Eventual Glucose - Target) / ISF =" = "(Eventual Glucose - Target) / ISF =";
/* Formula displayed in Bolus info pop-up. Make translation short! */
"(Eventual Glucose - Target) / ISF" = "(Eventual Glucose - Target) / ISF";

/* */
"Formula =" = "Formula =";

/* Bolus pop-up footer */
"Carbs and previous insulin are included in the glucose prediction, but if the Eventual Glucose is lower than the Target Glucose, a bolus will not be recommended." = "Carbs and previous insulin are included in the glucose prediction, but if the Eventual Glucose is lower than the Target Glucose, a bolus will not be recommended.";
Expand All @@ -1308,13 +1311,10 @@ Enact a temp Basal or a temp target */
"Hide" = "Hide";

/* Bolus pop-up / Alert string. Make translations concise! */
"Predicted Glucose, " = "Predicted Glucose, ";

/* Bolus pop-up / Alert string. Make translations concise! */
"is predicted below threshold " = "is predicted below threshold ";
"Eventual Glucose > Target Glucose, but glucose, " = "Eventual Glucose > Target Glucose, but glucose, ";

/* Bolus pop-up / Alert string. Make translations concise! */
"is below Threshold of " = "is below Threshold of ";
"is predicted below Threshold of " = "is predicted below Threshold of ";

/* Bolus pop-up / Alert string. Make translations concise! */
"Eventual Glucose > Target Glucose, but glucose is climbing slower than expected. Expected: " = "Eventual Glucose > Target Glucose, but glucose is climbing slower than expected. Expected: ";
Expand All @@ -1323,7 +1323,7 @@ Enact a temp Basal or a temp target */
". Climbing: " = ". Climbing: ";

/* Bolus pop-up / Alert string. Make translations concise! */
"Eventual Glucose > Target Glucose, but glucose is falling slower than expected. Expected: " = "Eventual Glucose > Target Glucose, but glucose is falling slower than expected. Expected: ";
"Eventual Glucose > Target Glucose, but glucose is falling faster than expected. Expected: " = "Eventual Glucose > Target Glucose, but glucose is falling faster than expected. Expected: ";

/* Bolus pop-up / Alert string. Make translations concise! */
". Falling: " = ". Falling: ";
Expand All @@ -1335,7 +1335,7 @@ Enact a temp Basal or a temp target */
". Changing: " = ". Changing: ";

/* Bolus pop-up / Alert string. Make translations concise! */
"Minimum predicted Glucose is " = "Minimum predicted Glucose is ";
"Eventual Glucose > Target Glucose, but glucose is predicted to drop down to " = "Glucose is predicted to drop to";

/* Add insulin without bolusing alert */
" without bolusing" = " without bolusing";
Expand Down
22 changes: 11 additions & 11 deletions FreeAPS/Sources/Localizations/Main/sv.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -1332,8 +1332,11 @@ Enact a temp Basal or a temp target */
/* */
"Insulin Sensitivity" = "Insulinkänslighet";

/* Formuala displayed in Bolus info pop-up. Make translation short! */
"(Eventual Glucose - Target) / ISF =" = "(Blodsockerprognos - Målvärde) / ISF =";
/* Formula displayed in Bolus info pop-up. Make translation short! */
"(Eventual Glucose - Target) / ISF" = "(Blodsockerprognos - Målvärde) / ISF";

/* */
"Formula =" = "Formel =";

/* Bolus pop-up footer */
"Carbs and previous insulin are included in the glucose prediction, but if the Eventual Glucose is lower than the Target Glucose, a bolus will not be recommended." = "Kolhydrater och tidigare insulin ingår i prognos, men om prognos är lägre än målvärde kommer ingen bolus att föreslås.";
Expand All @@ -1342,34 +1345,31 @@ Enact a temp Basal or a temp target */
"Hide" = "Göm";

/* Bolus pop-up / Alert string. Make translations concise! */
"Predicted Glucose, " = "Prognos, ";

/* Bolus pop-up / Alert string. Make translations concise! */
"is predicted below threshold " = "är under tröskelvärde ";
"Eventual Glucose > Target Glucose, but glucose, " = "Prognos > målvärde, men ditt blodsocker, ";

/* Bolus pop-up / Alert string. Make translations concise! */
"is below Threshold of " = "är under tröskelvärde ";
"is predicted below Threshold of " = "beräknas sjunka under tröskelvärde ";

/* Bolus pop-up / Alert string. Make translations concise! */
"Eventual Glucose > Target Glucose, but glucose is climbing slower than expected. Expected: " = "Prognos > Målvärde, men blodsocker stiger snabbare än väntat. Förväntat: ";
"Eventual Glucose > Target Glucose, but glucose is climbing slower than expected. Expected: " = "Prognos > Målvärde, men ditt blodsocker stiger långsammare än väntat. Förväntat: ";

//* Bolus pop-up / Alert string. Make translations concise! */
". Climbing: " = ". Stiger: ";

/* Bolus pop-up / Alert string. Make translations concise! */
"Eventual Glucose > Target Glucose, but glucose is falling slower than expected. Expected: " = "Prognos > Målvärde, men blodsocker sjunker snabbare än väntat. Förväntat: ";
"Eventual Glucose > Target Glucose, but glucose is falling faster than expected. Expected: " = "Prognos > målvärde, men blodsocker sjunker snabbare än väntat. Förväntat: ";

/* Bolus pop-up / Alert string. Make translations concise! */
". Falling: " = ". Sjunker: ";

/* Bolus pop-up / Alert string. Make translations concise! */
"Eventual Glucose > Target Glucose, but glucose is changing faster than expected. Expected: " = "Prognos > Målvärde, men blodsocker ändras snabbare än väntat. Förväntat: ";
"Eventual Glucose > Target Glucose, but glucose is changing faster than expected. Expected: " = "Prognos > målvärde, men blodsocker ändras snabbare än väntat. Förväntat: ";

/* Bolus pop-up / Alert string. Make translations concise! */
". Changing: " = ". Ändras: ";

/* Bolus pop-up / Alert string. Make translations concise! */
"Minimum predicted Glucose is " = "Lägsta prognos är ";
"Eventual Glucose > Target Glucose, but glucose is predicted to drop down to " = "Prognos är > målvärde, men blodsocker väntas ev sjunka till ";

/* Add insulin without bolusing alert */
" without bolusing" = " utan att ge insulin";
Expand Down
4 changes: 1 addition & 3 deletions FreeAPS/Sources/Modules/AddCarbs/AddCarbsStateModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ extension AddCarbs {
@Published var dish: String = ""
@Published var selection: Presets?
@Published var summation: [String] = []
@Published var manualBolus: Bool = false

let coredataContext = CoreDataStack.shared.persistentContainer.viewContext

Expand Down Expand Up @@ -109,8 +108,7 @@ extension AddCarbs {
apsManager.determineBasalSync()
showModal(for: nil)
} else {
manualBolus.toggle()
showModal(for: .bolus(waitForSuggestion: true, manualBolus: manualBolus))
showModal(for: .bolus(waitForSuggestion: true))
}
}

Expand Down
10 changes: 7 additions & 3 deletions FreeAPS/Sources/Modules/Bolus/BolusStateModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ extension Bolus {
@Injected() var apsManager: APSManager!
@Injected() var broadcaster: Broadcaster!
@Injected() var pumpHistoryStorage: PumpHistoryStorage!

@Published var amount: Decimal = 0
@Published var insulinRecommended: Decimal = 0
@Published var insulinRequired: Decimal = 0
@Published var waitForSuggestion: Bool = false
@Published var manual: Bool = false
@Published var error: Bool = false
@Published var errorString: Decimal = 0
@Published var evBG: Int = 0
Expand Down Expand Up @@ -96,7 +95,12 @@ extension Bolus {
DispatchQueue.main.async {
self.insulinRequired = self.provider.suggestion?.insulinReq ?? 0

// Manual Bolus recommendation screen after a carb entry (normally) yields a higher amount than the insulin reqiured amount computed for SMBs (auto boluses). Carbs combined with a manual bolus threfore now (test) uses the Eventual BG for glucose prediction, whereas the insulinReg for SMBs uses the minPredBG for glucose prediction (typically lower than Eventual BG).
// Manual Bolus recommendation (normally) yields a higher amount than the insulin reqiured amount computed for SMBs (auto boluses). A manual bolus threfore now (test) uses the Eventual BG for glucose prediction, whereas the insulinReg for SMBs uses the minPredBG for glucose prediction (typically lower than Eventual BG).

var conversion: Decimal = 1.0
if self.units == .mmolL {
conversion = 0.0555
}

var conversion: Decimal = 1.0
if self.units == .mmolL {
Expand Down
26 changes: 14 additions & 12 deletions FreeAPS/Sources/Modules/Bolus/View/BolusRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ extension Bolus {
struct RootView: BaseView {
let resolver: Resolver
let waitForSuggestion: Bool
let manualBolus: Bool
@StateObject var state = StateModel()

@State private var isAddInsulinAlertPresented = false
Expand Down Expand Up @@ -96,7 +95,7 @@ extension Bolus {
Alert(
title: Text("Are you sure?"),
message: Text(
"Add " + formatter
NSLocalizedString("Add", comment: "Add insulin without bolusing alert") + " " + formatter
.string(from: state.amount as NSNumber)! + NSLocalizedString(" U", comment: "Insulin unit") +
NSLocalizedString(" without bolusing", comment: "Add insulin without bolusing alert")
),
Expand Down Expand Up @@ -132,7 +131,7 @@ extension Bolus {
.alert(isPresented: $displayError) {
Alert(
title: Text("Warning!"),
message: Text("\n" + NSLocalizedString(state.errorString, comment: "") + NSLocalizedString(
message: Text("\n" + alertString() + NSLocalizedString(
"\n\nTap 'Add' to continue with selected amount.",
comment: "Alert text to confirm bolus amount to add"
)),
Expand All @@ -150,7 +149,6 @@ extension Bolus {
configureView {
state.waitForSuggestionInitial = waitForSuggestion
state.waitForSuggestion = waitForSuggestion
state.manual = manualBolus
}
}
.navigationTitle("Enact Bolus")
Expand Down Expand Up @@ -196,6 +194,10 @@ extension Bolus {
Text("%").foregroundColor(.secondary)
}
}
HStack {
Text("Formula =")
Text("(Eventual Glucose - Target) / ISF")
}.foregroundColor(.secondary).italic().padding(.top, 5)
}
.font(.footnote)
.padding(.top, 10)
Expand All @@ -206,11 +208,10 @@ extension Bolus {
" U",
comment: "Unit in number of units delivered (keep the space character!)"
)
Text("(Eventual Glucose - Target) / ISF =").font(.callout).italic()
let color: Color = (state.percentage != 100 && state.insulin > 0) ? .secondary : .blue
let fontWeight: Font.Weight = (state.percentage != 100 && state.insulin > 0) ? .regular : .bold
HStack {
Text(" = ").font(.callout)
Text(NSLocalizedString("Insulin recommended", comment: "") + ":").font(.callout)
Text(state.insulin.formatted() + unit).font(.callout).foregroundColor(color).fontWeight(fontWeight)
}
if state.percentage != 100, state.insulin > 0 {
Expand All @@ -231,6 +232,7 @@ extension Bolus {
Divider()
}.padding(.horizontal, 10)
}
// Footer
if !(state.error && state.insulinRecommended > 0) {
VStack {
Text(
Expand All @@ -257,25 +259,25 @@ extension Bolus {
switch state.errorString {
case 1:
return NSLocalizedString(
"Predicted Glucose, ",
"Eventual Glucose > Target Glucose, but glucose, ",
comment: "Bolus pop-up / Alert string. Make translations concise!"
) + state.minGuardBG
.formatted(.number.grouping(.never).rounded().precision(.fractionLength(fractionDigits))) + " " + state.units
.rawValue + ", " +
NSLocalizedString(
"is predicted below threshold ",
"is predicted below Threshold of ",
comment: "Bolus pop-up / Alert string. Make translations concise!"
) + state
.threshold.formatted(.number.grouping(.never).rounded().precision(.fractionLength(fractionDigits))) + "!"
case 2:
return NSLocalizedString(
"Predicted Glucose, ",
"Eventual Glucose > Target Glucose, but glucose, ",
comment: "Bolus pop-up / Alert string. Make translations concise!"
) + state.minGuardBG
.formatted(.number.grouping(.never).rounded().precision(.fractionLength(fractionDigits))) + " " + state.units
.rawValue + ", " +
NSLocalizedString(
"is below Threshold of ",
"is predicted below Threshold of ",
comment: "Bolus pop-up / Alert string. Make translations concise!"
) + state
.threshold.formatted(.number.grouping(.never).rounded().precision(.fractionLength(fractionDigits)))
Expand All @@ -290,7 +292,7 @@ extension Bolus {
.minDelta.formatted(.number.grouping(.never).rounded().precision(.fractionLength(fractionDigits)))
case 4:
return NSLocalizedString(
"Eventual Glucose > Target Glucose, but glucose is falling slower than expected. Expected: ",
"Eventual Glucose > Target Glucose, but glucose is falling faster than expected. Expected: ",
comment: "Bolus pop-up / Alert string. Make translations concise!"
) +
state.expectedDelta
Expand All @@ -308,7 +310,7 @@ extension Bolus {
.minDelta.formatted(.number.grouping(.never).rounded().precision(.fractionLength(fractionDigits)))
case 6:
return NSLocalizedString(
"Minimum predicted Glucose is ",
"Eventual Glucose > Target Glucose, but glucose is predicted to drop down to ",
comment: "Bolus pop-up / Alert string. Make translations concise!"
) + state
.minPredBG
Expand Down
2 changes: 1 addition & 1 deletion FreeAPS/Sources/Modules/Home/View/HomeRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ extension Home {
.padding(8)
}.foregroundColor(.loopGreen)
Spacer()
Button { state.showModal(for: .bolus(waitForSuggestion: false, manualBolus: false)) }
Button { state.showModal(for: .bolus(waitForSuggestion: false)) }
label: {
Image("bolus")
.renderingMode(.template)
Expand Down
6 changes: 3 additions & 3 deletions FreeAPS/Sources/Router/Screen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ enum Screen: Identifiable, Hashable {
case preferencesEditor
case addCarbs
case addTempTarget
case bolus(waitForSuggestion: Bool, manualBolus: Bool)
case bolus(waitForSuggestion: Bool)
case manualTempBasal
case autotuneConfig
case dataTable
Expand Down Expand Up @@ -67,8 +67,8 @@ extension Screen {
AddCarbs.RootView(resolver: resolver)
case .addTempTarget:
AddTempTarget.RootView(resolver: resolver)
case let .bolus(waitForSuggestion, manualBolus):
Bolus.RootView(resolver: resolver, waitForSuggestion: waitForSuggestion, manualBolus: manualBolus)
case let .bolus(waitForSuggestion):
Bolus.RootView(resolver: resolver, waitForSuggestion: waitForSuggestion)
case .manualTempBasal:
ManualTempBasal.RootView(resolver: resolver)
case .autotuneConfig:
Expand Down

0 comments on commit e054547

Please sign in to comment.