Skip to content

Commit

Permalink
Fix brave/brave-ios#8431: Copy mistake in confirmation message after …
Browse files Browse the repository at this point in the history
…resetting VPN config (brave/brave-ios#8443)
  • Loading branch information
soner-yuksel authored Nov 20, 2023
1 parent 3d799ff commit f2b7fd3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
15 changes: 10 additions & 5 deletions Sources/BraveStrings/BraveStrings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2821,7 +2821,7 @@ extension Strings {
comment: "Button to manage your VPN subscription")

public static let settingsRedeemOfferCode =
NSLocalizedString("vpn.settingsManageSubscription", tableName: "BraveShared", bundle: .module,
NSLocalizedString("vpn.settingsRedeemOfferCode", tableName: "BraveShared", bundle: .module,
value: "Redeem Offer Code",
comment: "Button to redeem offer code subscription")

Expand Down Expand Up @@ -3067,22 +3067,27 @@ extension Strings {

public static let resetVPNErrorTitle =
NSLocalizedString("vpn.resetVPNErrorTitle", tableName: "BraveShared", bundle: .module,
value: "Error",
value: "Reset Failed",
comment: "Title for error message when vpn configuration reset fails.")

public static let resetVPNErrorBody =
NSLocalizedString("vpn.resetVPNErrorBody", tableName: "BraveShared", bundle: .module,
value: "Failed to reset vpn configuration, please try again later.",
value: "Unable to reset VPN configuration. Please try again. If the issue persists, contact support for assistance.",
comment: "Message to show when vpn configuration reset fails.")

public static let resetVPNErrorButtonActionTitle =
NSLocalizedString("vpn.resetVPNErrorButtonActionTitle", tableName: "BraveShared", bundle: .module,
value: "Try Again",
comment: "Title of button to try again when vpn configuration reset fails.")

public static let resetVPNSuccessTitle =
NSLocalizedString("vpn.resetVPNSuccessTitle", tableName: "BraveShared", bundle: .module,
value: "Success",
value: "Reset Successful",
comment: "Title for success message when vpn configuration reset succeeds.")

public static let resetVPNSuccessBody =
NSLocalizedString("vpn.resetVPNSuccessBody", tableName: "BraveShared", bundle: .module,
value: "VPN Configuration is reset successfully.",
value: "VPN configuration has been reset successfully.",
comment: "Message to show when vpn configuration reset succeeds.")

public static let contactFormDoNotEditText =
Expand Down
13 changes: 11 additions & 2 deletions Sources/BraveVPN/BraveVPNSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,17 @@ public class BraveVPNSettingsViewController: TableViewController {
message: success ? Strings.VPN.resetVPNSuccessBody : Strings.VPN.resetVPNErrorBody,
preferredStyle: .alert)

let okAction = UIAlertAction(title: Strings.OKString, style: .default)
alert.addAction(okAction)
if success {
let okAction = UIAlertAction(title: Strings.OKString, style: .default)
alert.addAction(okAction)
} else {
alert.addAction(UIAlertAction(title: Strings.close, style: .cancel, handler: nil))
alert.addAction(UIAlertAction(
title: Strings.VPN.resetVPNErrorButtonActionTitle, style: .default,
handler: { [weak self] _ in
self?.resetConfigurationTapped()
}))
}

present(alert, animated: true)
}
Expand Down

0 comments on commit f2b7fd3

Please sign in to comment.