Externalize location alert strings

This commit is contained in:
Davide De Rosa 2019-10-21 00:20:04 +02:00
parent 9b96707d5b
commit 5ae4abf401
3 changed files with 16 additions and 2 deletions

View File

@ -75,6 +75,18 @@ internal enum L10n {
}
}
internal enum Service {
internal enum Alerts {
internal enum Location {
internal enum Button {
/// Settings
internal static let settings = L10n.tr("App", "service.alerts.location.button.settings")
}
internal enum Message {
/// You must allow location access to trust this Wi-Fi network. Go to iOS settings and review your location permissions for Passepartout.
internal static let denied = L10n.tr("App", "service.alerts.location.message.denied")
}
}
}
internal enum Cells {
internal enum Host {
internal enum Parameters {

View File

@ -40,6 +40,8 @@
"service.cells.provider.refresh.caption" = "Refresh infrastructure";
"service.cells.host.parameters.caption" = "Parameters";
"service.cells.trusted_add_wifi.caption" = "Add current Wi-Fi";
"service.alerts.location.message.denied" = "You must allow location access to trust this Wi-Fi network. Go to iOS settings and review your location permissions for Passepartout.";
"service.alerts.location.button.settings" = "Settings";
"account.sections.credentials.header" = "Credentials";

View File

@ -351,10 +351,10 @@ class ServiceViewController: UIViewController, StrongTableHost {
case .denied:
let alert = UIAlertController.asAlert(
L10n.App.Service.Cells.TrustedAddWifi.caption,
"You must allow location access to trust this Wi-Fi network. Go to iOS settings and review your location permissions for Passepartout."
L10n.App.Service.Alerts.Location.Message.denied
)
alert.addCancelAction(L10n.Core.Global.ok)
alert.addPreferredAction("Settings") {
alert.addPreferredAction(L10n.App.Service.Alerts.Location.Button.settings) {
UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!, options: [:], completionHandler: nil)
}
present(alert, animated: true, completion: nil)