|
|
@@ -37,7 +37,7 @@ struct ContactSettingsView: View {
|
|
|
|
|
|
Picker("Background Color", selection: $viewModel.contactBackgroundColor) {
|
|
|
ForEach(ContactColorOption.allCases, id: \.rawValue) { option in
|
|
|
- Text(option.rawValue.capitalized).tag(option.rawValue)
|
|
|
+ Text(LocalizedStringKey(option.rawValue.capitalized)).tag(option.rawValue)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -50,7 +50,7 @@ struct ContactSettingsView: View {
|
|
|
if viewModel.contactColorMode == .staticColor {
|
|
|
Picker("Text Color", selection: $viewModel.contactTextColor) {
|
|
|
ForEach(ContactColorOption.allCases, id: \.rawValue) { option in
|
|
|
- Text(option.rawValue.capitalized).tag(option.rawValue)
|
|
|
+ Text(LocalizedStringKey(option.rawValue.capitalized)).tag(option.rawValue)
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
@@ -70,7 +70,7 @@ struct ContactSettingsView: View {
|
|
|
.font(.subheadline)
|
|
|
Picker("Show Trend", selection: $viewModel.contactTrend) {
|
|
|
ForEach(ContactIncludeOption.allCases, id: \.self) { option in
|
|
|
- Text(option.rawValue).tag(option)
|
|
|
+ Text(LocalizedStringKey(option.rawValue)).tag(option)
|
|
|
}
|
|
|
}
|
|
|
.pickerStyle(SegmentedPickerStyle())
|
|
|
@@ -78,7 +78,7 @@ struct ContactSettingsView: View {
|
|
|
if viewModel.contactTrend == .include {
|
|
|
Picker("Include Trend in", selection: $viewModel.contactTrendTarget) {
|
|
|
ForEach(viewModel.availableTargets(for: .Trend), id: \.self) { target in
|
|
|
- Text(target.rawValue).tag(target)
|
|
|
+ Text(LocalizedStringKey(target.rawValue)).tag(target)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -87,7 +87,7 @@ struct ContactSettingsView: View {
|
|
|
.font(.subheadline)
|
|
|
Picker("Show Delta", selection: $viewModel.contactDelta) {
|
|
|
ForEach(ContactIncludeOption.allCases, id: \.self) { option in
|
|
|
- Text(option.rawValue).tag(option)
|
|
|
+ Text(LocalizedStringKey(option.rawValue)).tag(option)
|
|
|
}
|
|
|
}
|
|
|
.pickerStyle(SegmentedPickerStyle())
|
|
|
@@ -95,7 +95,7 @@ struct ContactSettingsView: View {
|
|
|
if viewModel.contactDelta == .include {
|
|
|
Picker("Include Delta in", selection: $viewModel.contactDeltaTarget) {
|
|
|
ForEach(viewModel.availableTargets(for: .Delta), id: \.self) { target in
|
|
|
- Text(target.rawValue).tag(target)
|
|
|
+ Text(LocalizedStringKey(target.rawValue)).tag(target)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -104,7 +104,7 @@ struct ContactSettingsView: View {
|
|
|
.font(.subheadline)
|
|
|
Picker("Show IOB", selection: $viewModel.contactIOB) {
|
|
|
ForEach(ContactIncludeOption.allCases, id: \.self) { option in
|
|
|
- Text(option.rawValue).tag(option)
|
|
|
+ Text(LocalizedStringKey(option.rawValue)).tag(option)
|
|
|
}
|
|
|
}
|
|
|
.pickerStyle(SegmentedPickerStyle())
|
|
|
@@ -112,7 +112,7 @@ struct ContactSettingsView: View {
|
|
|
if viewModel.contactIOB == .include {
|
|
|
Picker("Include IOB in", selection: $viewModel.contactIOBTarget) {
|
|
|
ForEach(viewModel.availableTargets(for: .IOB), id: \.self) { target in
|
|
|
- Text(target.rawValue).tag(target)
|
|
|
+ Text(LocalizedStringKey(target.rawValue)).tag(target)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -137,19 +137,19 @@ struct ContactSettingsView: View {
|
|
|
DispatchQueue.main.async {
|
|
|
if !granted {
|
|
|
viewModel.contactEnabled = false
|
|
|
- showAlert(title: "Access Denied", message: "Please allow access to Contacts in Settings to enable this feature.")
|
|
|
+ showAlert(title: String(localized: "Access Denied"), message: String(localized: "Please allow access to Contacts in Settings to enable this feature."))
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
} else if status == .denied {
|
|
|
viewModel.contactEnabled = false
|
|
|
- showAlert(title: "Access Denied", message: "Access to Contacts is denied. Please go to Settings and enable Contacts access.")
|
|
|
+ showAlert(title: String(localized: "Access Denied"), message: String(localized: "Access to Contacts is denied. Please go to Settings and enable Contacts access."))
|
|
|
} else if status == .restricted {
|
|
|
viewModel.contactEnabled = false
|
|
|
- showAlert(title: "Access Restricted", message: "Access to Contacts is restricted.")
|
|
|
+ showAlert(title: String(localized: "Access Restricted"), message: String(localized: "Access to Contacts is restricted."))
|
|
|
} else {
|
|
|
viewModel.contactEnabled = false
|
|
|
- showAlert(title: "Error", message: "An unknown error occurred while checking Contacts access.")
|
|
|
+ showAlert(title: String(localized: "Error"), message: String(localized: "An unknown error occurred while checking Contacts access."))
|
|
|
}
|
|
|
}
|
|
|
|