Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 6 additions & 1 deletion ENGAGEHF/Dashboard/Messages/MessageRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ struct MessageRow: View {

return Image(systemName: imageName)
.cardSymbolStyle()
.accessibilityLabel(message.action.localizedDescription.localizedString() + " Symbol")
.accessibilityLabel(
String(
localized: "\(message.action.localizedDescription.localizedString()) Symbol",
comment: "Accessibility label for message action icon"
)
)
}

private var processingStateView: some View {
Expand Down
15 changes: 10 additions & 5 deletions ENGAGEHF/Dashboard/Messages/MessagesSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,16 @@ struct MessagesSection: View {


private func constructAccessibilityLabel(from message: Message) -> String {
"""
Message: \(message.title), \
description: \(message.description ?? "none"), \
action: \(message.action.localizedDescription.localizedString()).
"""
let title = message.title
let description = message.description ?? String(
localized: "No description",
comment: "Accessibility placeholder for missing message description"
)
let action = message.action.localizedDescription.localizedString()
return String(
localized: "Message: \(title), description: \(description), action: \(action).",
comment: "Accessibility label for a message card"
)
}
}

Expand Down
10 changes: 6 additions & 4 deletions ENGAGEHF/HeartHealth/AddMeasurement/AddMeasurementView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,18 @@ struct AddMeasurementView: View {
switch type {
case .bloodPressure:
self.fields = [
FieldDetails(title: "Systolic"),
FieldDetails(title: "Diastolic")
FieldDetails(title: String(localized: "Systolic", comment: "Blood pressure field label")),
FieldDetails(title: String(localized: "Diastolic", comment: "Blood pressure field label"))
]
case .weight:
self.fields = [
FieldDetails(title: Locale.current.measurementSystem == .us ? "lb" : "kg")
FieldDetails(title: Locale.current.measurementSystem == .us
? String(localized: "lb", comment: "Unit abbreviation for pounds")
: String(localized: "kg", comment: "Unit abbreviation for kilograms"))
]
case .heartRate:
self.fields = [
FieldDetails(title: "BPM")
FieldDetails(title: String(localized: "BPM", comment: "Unit abbreviation for beats per minute"))
]
default:
self.fields = []
Expand Down
2 changes: 1 addition & 1 deletion ENGAGEHF/HeartHealth/GraphPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct GraphPicker: View {
var body: some View {
Picker("Graph Selection", selection: $selection) {
ForEach(GraphSelection.allCases) { selection in
Text(String(describing: selection))
Text(selection.description)
.multilineTextAlignment(.center)
}
}
Expand Down
18 changes: 9 additions & 9 deletions ENGAGEHF/HeartHealth/SelectionTypes/GraphSelection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ enum GraphSelection: CaseIterable, Identifiable, CustomStringConvertible, Equata

var description: String {
switch self {
case .symptoms: "Symptoms"
case .weight: "Weight"
case .heartRate: "HR"
case .bloodPressure: "BP"
case .symptoms: String(localized: "Symptoms", comment: "Graph selection short label")
case .weight: String(localized: "Weight", comment: "Graph selection short label")
case .heartRate: String(localized: "HR", comment: "Graph selection short label for Heart Rate")
case .bloodPressure: String(localized: "BP", comment: "Graph selection short label for Blood Pressure")
}
}

var fullName: String {
switch self {
case .symptoms: "Symptom Score"
case .weight: "Body Weight"
case .heartRate: "Heart Rate"
case .bloodPressure: "Blood Pressure"
case .symptoms: String(localized: "Symptom Score", comment: "Graph selection full name")
case .weight: String(localized: "Body Weight", comment: "Graph selection full name")
case .heartRate: String(localized: "Heart Rate", comment: "Graph selection full name")
case .bloodPressure: String(localized: "Blood Pressure", comment: "Graph selection full name")
}
}

Expand Down
28 changes: 14 additions & 14 deletions ENGAGEHF/HeartHealth/SelectionTypes/SymptomsType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,25 @@ enum SymptomsType: String, CaseIterable, Identifiable, CustomStringConvertible,
/// The name displayed in the Picker UI element for selecting the symptom type to be shown
var description: String {
switch self {
case .overall: "Overall"
case .physical: "Physical"
case .social: "Social"
case .quality: "Quality of Life"
case .specific: "Symptoms"
case .dizziness: "Dizziness"
case .overall: String(localized: "Overall", comment: "Symptom type picker label")
case .physical: String(localized: "Physical", comment: "Symptom type picker label")
case .social: String(localized: "Social", comment: "Symptom type picker label")
case .quality: String(localized: "Quality of Life", comment: "Symptom type picker label")
case .specific: String(localized: "Specific Symptoms", comment: "Symptom type picker label")
case .dizziness: String(localized: "Dizziness", comment: "Symptom type picker label")
}
}


/// The full name of the score, displayed in the Description Header
var fullName: String {
switch self {
case .overall: "Overall Score"
case .physical: "Physical Limits Score"
case .social: "Social Limits Score"
case .quality: "Quality of Life Score"
case .specific: "Symptom Frequency Score"
case .dizziness: "Dizziness Score"
case .overall: String(localized: "Overall Score", comment: "Symptom score full name")
case .physical: String(localized: "Physical Limits Score", comment: "Symptom score full name")
case .social: String(localized: "Social Limits Score", comment: "Symptom score full name")
case .quality: String(localized: "Quality of Life Score", comment: "Symptom score full name")
case .specific: String(localized: "Symptom Frequency Score", comment: "Symptom score full name")
case .dizziness: String(localized: "Dizziness Score", comment: "Symptom score full name")
}
}

Expand Down
6 changes: 3 additions & 3 deletions ENGAGEHF/HeartHealth/SelectionTypes/VitalsType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ enum VitalsType: CustomStringConvertible {

var description: String {
switch self {
case .weight: "Body Weight"
case .heartRate: "Heart Rate"
case .bloodPressure: "Blood Pressure"
case .weight: String(localized: "Body Weight", comment: "Vitals type label")
case .heartRate: String(localized: "Heart Rate", comment: "Vitals type label")
case .bloodPressure: String(localized: "Blood Pressure", comment: "Vitals type label")
}
}

Expand Down
6 changes: 3 additions & 3 deletions ENGAGEHF/HeartHealth/Shared/DateGranularity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ enum DateGranularity: CustomStringConvertible, CaseIterable, Identifiable {

var description: String {
switch self {
case .daily: "Daily"
case .weekly: "Weekly"
case .monthly: "Monthly"
case .daily: String(localized: "Daily", comment: "Date granularity picker label")
case .weekly: String(localized: "Weekly", comment: "Date granularity picker label")
case .monthly: String(localized: "Monthly", comment: "Date granularity picker label")
}
}

Expand Down
12 changes: 12 additions & 0 deletions ENGAGEHF/Managers/MedicationsManager/MedicationDetails.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ enum MedicationRecommendationType: String, Decodable, Comparable {
case noActionRequired


var localizedDescription: String {
switch self {
case .targetDoseReached: String(localized: "Target Dose Reached", comment: "Medication recommendation type")
case .personalTargetDoseReached: String(localized: "Personal Target Dose Reached", comment: "Medication recommendation type")
case .improvementAvailable: String(localized: "Improvement Available", comment: "Medication recommendation type")
case .morePatientObservationsRequired: String(localized: "More Patient Observations Required", comment: "Medication recommendation type")
case .moreLabObservationsRequired: String(localized: "More Lab Observations Required", comment: "Medication recommendation type")
case .notStarted: String(localized: "Not Started", comment: "Medication recommendation type")
case .noActionRequired: String(localized: "No Action Required", comment: "Medication recommendation type")
}
}

var style: RecommendationStyle {
switch self {
case .targetDoseReached: .targetReached
Expand Down
8 changes: 4 additions & 4 deletions ENGAGEHF/Managers/VitalsManager/VitalsUnit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ enum VitalsUnit: CustomStringConvertible {

var description: String {
switch self {
case .lbs: "lb"
case .kgs: "kg"
case .mmHg: "mmHg"
case .bpm: "BPM"
case .lbs: String(localized: "lb", comment: "Unit abbreviation for pounds")
case .kgs: String(localized: "kg", comment: "Unit abbreviation for kilograms")
case .mmHg: String(localized: "mmHg", comment: "Unit abbreviation for millimeters of mercury")
case .bpm: String(localized: "BPM", comment: "Unit abbreviation for beats per minute")
}
}

Expand Down
10 changes: 8 additions & 2 deletions ENGAGEHF/Medications/MedicationsList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,16 @@ struct MedicationsList: View {
if containsRecommendations {
List {
if !currentlyTakenMedications.isEmpty {
MedicationSection(header: "Current Medications", medications: currentlyTakenMedications)
MedicationSection(
header: String(localized: "Current Medications", comment: "Medication section header"),
medications: currentlyTakenMedications
)
}
if !notCurrentlyTakenMedications.isEmpty {
MedicationSection(header: "Medications That May Help", medications: notCurrentlyTakenMedications)
MedicationSection(
header: String(localized: "Medications That May Help", comment: "Medication section header"),
medications: notCurrentlyTakenMedications
)
}
ColorLegend()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ struct MedicationRecommendationSymbol: View {
.resizable()
.frame(width: 35, height: 35)
.foregroundStyle(type.style.color)
.accessibilityLabel("Medication Label: \(type.rawValue)")
.accessibilityLabel(
String(
localized: "Medication Label: \(type.localizedDescription)",
comment: "Accessibility label for medication recommendation symbol"
)
)
}
}

Expand Down
Loading
Loading