Skip to content

Commit

Permalink
Localization fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ps2 committed Feb 10, 2023
1 parent 35379a8 commit f6efd72
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion LoopUI/Charts/IOBChart.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ import Foundation
import LoopKit
import LoopKitUI
import SwiftCharts
import HealthKit


public class IOBChart: ChartProviding {

static let chartUnit = HKUnit.internationalUnit()

public init() {
}

Expand Down Expand Up @@ -106,7 +110,7 @@ public extension IOBChart {
iobPoints = iobValues.map {
return ChartPoint(
x: ChartAxisValueDate(date: $0.startDate, formatter: dateFormatter),
y: ChartAxisValueDoubleUnit($0.value, unitString: "U", formatter: doseFormatter)
y: ChartAxisValueDoubleUnit($0.value, unitString: Self.chartUnit.localizedShortUnitString, formatter: doseFormatter)
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion LoopUI/Views/LoopCompletionHUDView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ extension LoopCompletionHUDView {
if loopStateView.open {
let reason = closedLoopDisallowedLocalizedDescription ?? NSLocalizedString("Tap Settings to toggle Closed Loop ON if you wish for the app to automate your insulin.", comment: "Instructions for user to close loop if it is allowed.")
return (title: LocalizedString("Closed Loop OFF", comment: "Title of green open loop OFF message"),
message: String(format: NSLocalizedString("\n%1$@ is operating with Closed Loop in the OFF position. Your pump and CGM will continue operating, but the app will not adjust dosing automatically.\n\n%2$@", comment: "Green closed loop OFF message (1: app name)(2: reason for open loop)"), Bundle.main.bundleDisplayName, reason))
message: String(format: LocalizedString("\n%1$@ is operating with Closed Loop in the OFF position. Your pump and CGM will continue operating, but the app will not adjust dosing automatically.\n\n%2$@", comment: "Green closed loop OFF message (1: app name)(2: reason for open loop)"), Bundle.main.bundleDisplayName, reason))
} else {
return (title: LocalizedString("Closed Loop ON", comment: "Title of green closed loop ON message"),
message: String(format: LocalizedString("\n%1$@\n\n%2$@ is operating with Closed Loop in the ON position.", comment: "Green closed loop ON message (1: last loop string) (2: app name)"), lastLoopMessage, Bundle.main.bundleDisplayName))
Expand Down

0 comments on commit f6efd72

Please sign in to comment.