Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update strings #113

Merged
merged 49 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
69edd7c
Release 2.0.0 (#78)
Jon-b-m May 26, 2023
b7a206d
25. Sync duration. Missing commit
Jon-b-m May 26, 2023
985ed22
Fix for weird popover bug I can't explain. Replace the popover with s…
Jon-b-m May 26, 2023
35e7362
Add all profile settings to card info.
Jon-b-m May 27, 2023
241ea16
Profles select prest bug
Jon-b-m May 27, 2023
1820508
Format new Watch display options
Jon-b-m May 30, 2023
078d291
Format Apple Watch Override
Jon-b-m May 31, 2023
1a4ab87
More localization and Crowdin translations
Jon-b-m Jun 3, 2023
bd6b40f
Add % < 3.3 mmol/l and % > 11 mmol/l.
Jon-b-m Jun 3, 2023
e0454e4
Single target range (#94)
Jon-b-m Jun 3, 2023
23f8999
Change Sigmoid dynamic CR ratio to 100% of dynamic ISF ratio.
Jon-b-m Jun 4, 2023
551be37
Display scheduled basal dots
Jon-b-m Jun 4, 2023
2e8b5bc
Improve logging dynamic CR
Jon-b-m Jun 4, 2023
c5ae091
Bump version.xcconfig
Jon-b-m Jun 4, 2023
f44fd2b
Add euglucemic range.
Jon-b-m Jun 4, 2023
9f95d6b
Add euglucemic range.
Jon-b-m Jun 4, 2023
4c77239
Merge remote-tracking branch 'refs/remotes/origin/dev'
Jon-b-m Jun 4, 2023
ff7c4a7
Format TIR Chart.
Jon-b-m Jun 4, 2023
fe174f0
More formatting
Jon-b-m Jun 4, 2023
c15a715
Update Config.xcconfig
Jon-b-m Jun 5, 2023
e2e43bd
Merge branch 'main' into dev
Jon-b-m Jun 5, 2023
421793c
Bug fix for empty glucose data
Jon-b-m Jun 6, 2023
561cf1c
Add Manual Glucose. Test Co
Jon-b-m Jun 7, 2023
d8ae953
Clean up
Jon-b-m Jun 7, 2023
99f9b50
Bump version
Jon-b-m Jun 7, 2023
3e39fad
Prevent Xcode build error for some users?
Jon-b-m Jun 7, 2023
91f79c2
Avoid double saving
Jon-b-m Jun 7, 2023
ceedda2
Correction
Jon-b-m Jun 8, 2023
6edda04
Improve the bolus calculator. (#98)
Jon-b-m Jun 8, 2023
9361bca
Add euglycemic range also to laying grouped glucose in laying TIR cha…
Jon-b-m Jun 8, 2023
af03c7f
Bug fix. Glucose conversion
Jon-b-m Jun 9, 2023
ac066cc
Bolus calculator (#101)
Jon-b-m Jun 11, 2023
5792fb9
Allow for larger range for low/high settings in stats and Home View
Jon-b-m Jun 12, 2023
e6ad164
More error strings.
Jon-b-m Jun 12, 2023
3be9604
New Libre 2 versions. Support for patchInfo starting with "c5" (#104)
Jon-b-m Jun 12, 2023
819c53e
Crowdin translations (#106)
Jon-b-m Jun 12, 2023
902b782
Use systemGray and gradient
Jon-b-m Jun 13, 2023
f6fb807
Revert
Jon-b-m Jun 13, 2023
19893c8
1.Bug fix for adding insulin without blousing.
Jon-b-m Jun 14, 2023
ff0e92f
Clean
Jon-b-m Jun 14, 2023
e554424
Missing loc
Jon-b-m Jun 14, 2023
da8da82
Merge branch 'Crowdin' into dev
Jon-b-m Jun 14, 2023
5bf8537
Merge fix
Jon-b-m Jun 14, 2023
8c487bd
More clean up
Jon-b-m Jun 14, 2023
cfef393
Comment
Jon-b-m Jun 14, 2023
e948323
Bug fixes.
Jon-b-m Jun 15, 2023
9a5010a
Describe better... and missing localization commit
Jon-b-m Jun 15, 2023
cb5cdef
Formatting and more missing localization
Jon-b-m Jun 15, 2023
6891e28
Merge branch 'Crowdin' into dev
Jon-b-m Jun 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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