Skip to content

Commit

Permalink
REGRESSION (252540@main): Lockdown Mode alert contains "localized str…
Browse files Browse the repository at this point in the history
…ing not found"

https://bugs.webkit.org/show_bug.cgi?id=243169
rdar://97555448

Reviewed by Wenson Hsieh.

252540@main upstreamed Lockdown Mode code into open source, but incorrectly
omitted the localized string for the Lockdown Mode alert button.

* Source/WebCore/en.lproj/Localizable.strings:

Consolidate the "OK" alert button label into a single localizable string.

"OK (OK button title in extra zoomed number pad)" is kept as a separate string
since it receives different translations due to the compact nature of the UI.

* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _presentCaptivePortalMode]):
* Source/WebKit/UIProcess/ios/WKPasswordView.mm:
(-[WKPasswordView showPasswordFailureAlert]):

Canonical link: https://commits.webkit.org/252792@main
  • Loading branch information
pxlcoder committed Jul 25, 2022
1 parent e635baf commit 5b2c235
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Source/WebCore/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -697,12 +697,12 @@
/* Option in segmented control for inserting a numbered list in text editing */
"Numbered list" = "Numbered list";

/* Label for OK button in alerts */
"OK" = "OK";

/* Title of the OK button for the number pad in zoomed form controls. */
"OK (OK button title in extra zoomed number pad)" = "OK";

/* OK button label in document password failure alert */
"OK (document password failure alert)" = "OK";

/* Menu item label for the track that represents disabling closed captions. */
"Off (text track)" = "Off";

Expand Down
6 changes: 3 additions & 3 deletions Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3039,9 +3039,9 @@ - (void)_presentCaptivePortalMode
alertControllerWithTitle:[NSString stringWithFormat:WEB_UI_NSSTRING(@"Lockdown Mode is Turned On For “%@", "Lockdown Mode alert title"), appDisplayName]
message:message
preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:WEB_UI_NSSTRING(@"OK", "Captive Portal Mode alert OK button") style:UIAlertActionStyleDefault handler:nil]];

[alert addAction:[UIAlertAction actionWithTitle:WEB_UI_NSSTRING(@"OK", "Lockdown Mode alert OK button") style:UIAlertActionStyleDefault handler:nil]];

UIViewController *presentationViewController = [UIViewController _viewControllerForFullScreenPresentationFromView:protectedSelf.get()];
[presentationViewController presentViewController:alert animated:YES completion:nil];
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:WebKitCaptivePortalModeAlertShownKey];
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/UIProcess/ios/WKPasswordView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ - (void)showPasswordFailureAlert
[[_passwordView passwordField] setText:@""];
UIAlertController *alert = [UIAlertController alertControllerWithTitle:WEB_UI_STRING("The document could not be opened with that password.", "document password failure alert message") message:@"" preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:WEB_UI_STRING_KEY("OK", "OK (document password failure alert)", "OK button label in document password failure alert") style:UIAlertActionStyleDefault handler:[](UIAlertAction *) { }];
UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:WEB_UI_STRING("OK", "OK button label in document password failure alert") style:UIAlertActionStyleDefault handler:[](UIAlertAction *) { }];

[alert addAction:defaultAction];

Expand Down

0 comments on commit 5b2c235

Please sign in to comment.