Skip to content

Commit

Permalink
Address custom localized_comment violations
Browse files Browse the repository at this point in the history
  • Loading branch information
mokagio committed Jan 17, 2024
1 parent 72b1f13 commit d13c749
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion WordPressKit/HTTPAuthenticationAlertController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ open class HTTPAuthenticationAlertController {

private static func controllerForServerTrustChallenge(_ challenge: URLAuthenticationChallenge) -> UIAlertController {
let title = NSLocalizedString("Certificate error", comment: "Popup title for wrong SSL certificate.")
let message = String(format: NSLocalizedString("The certificate for this server is invalid. You might be connecting to a server that is pretending to be “%@” which could put your confidential information at risk.\n\nWould you like to trust the certificate anyway?", comment: ""), challenge.protectionSpace.host)
let localizedMessage = NSLocalizedString(
"The certificate for this server is invalid. You might be connecting to a server that is pretending to be “%@” which could put your confidential information at risk.\n\nWould you like to trust the certificate anyway?",
comment: "Message for when the certificate for the server is invalid. The %@ placeholder will be replaced the a host name, received from the API."
)
let message = String(format: localizedMessage, challenge.protectionSpace.host)
let controller = UIAlertController(title: title, message: message, preferredStyle: .alert)

let cancelAction = UIAlertAction(title: NSLocalizedString("Cancel", comment: "Cancel button label"),
Expand Down
5 changes: 4 additions & 1 deletion WordPressKit/WordPressOrgXMLRPCValidator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ import Foundation
case .notWordPressError:
return NSLocalizedString("That doesn't look like a WordPress site.", comment: "Message to show to user when he tries to add a self-hosted site that isn't a WordPress site.")
case .mobilePluginRedirectedError:
return NSLocalizedString("You seem to have installed a mobile plugin from DudaMobile which is preventing the app to connect to your blog", comment: "")
return NSLocalizedString(
"You seem to have installed a mobile plugin from DudaMobile which is preventing the app to connect to your blog",
comment: "Error messaged show when a mobile plugin is redirecting traffict to their site, DudaMobile in particular"
)
case .invalid:
return NSLocalizedString("Couldn't connect to the WordPress site. There is no valid WordPress site at this address. Check the site address (URL) you entered.", comment: "Error message shown a URL points to a valid site but not a WordPress site.")
case .blocked:
Expand Down

0 comments on commit d13c749

Please sign in to comment.