Use separate strings for app and system settings

This commit is contained in:
Elaine 2025-04-03 10:45:53 -06:00 committed by GitHub
parent 8d8c1ef921
commit f90632fbff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 23 additions and 19 deletions

View File

@ -26,8 +26,7 @@ class LimitedPhotoPermissionsView: UIView {
),
image: UIImage(named: "settings-light")
) { _ in
let openSettingsURL = URL(string: UIApplication.openSettingsURLString)!
UIApplication.shared.open(openSettingsURL)
CurrentAppContext().openSystemSettings()
}
var buttonConfig = UIButton.Configuration.gray()

View File

@ -459,7 +459,7 @@ public class ChatListViewController: OWSViewController, HomeTabViewController {
self?.showAppSettings()
}
)
barButtonItem.accessibilityLabel = CommonStrings.openSettingsButton
barButtonItem.accessibilityLabel = CommonStrings.openAppSettingsButton
barButtonItem.accessibilityIdentifier = "ChatListViewController.settingsButton"
return barButtonItem
}

View File

@ -347,10 +347,7 @@ class ConversationSplitViewController: UISplitViewController, ConversationSplit
action: #selector(showAppSettings),
input: ",",
modifierFlags: .command,
discoverabilityTitle: OWSLocalizedString(
"KEY_COMMAND_SETTINGS",
comment: "A keyboard command to present the application settings dialog."
)
discoverabilityTitle: CommonStrings.openAppSettingsButton
),
UIKeyCommand(
action: #selector(focusSearch),

View File

@ -20,13 +20,13 @@ extension HomeTabViewController {
showAppSettings: @escaping () -> Void
) -> UIBarButtonItem {
let settingsAction = UIAction(
title: CommonStrings.openSettingsButton,
title: CommonStrings.openAppSettingsButton,
image: Theme.iconImage(.contextMenuSettings),
handler: { _ in showAppSettings() }
)
let contextButton = ContextMenuButton(actions: buildActions(settingsAction))
contextButton.accessibilityLabel = CommonStrings.openSettingsButton
contextButton.accessibilityLabel = CommonStrings.openAppSettingsButton
let avatarView = ConversationAvatarView(
sizeClass: .twentyEight,
@ -55,7 +55,7 @@ extension HomeTabViewController {
}
let barButtonItem = UIBarButtonItem(customView: barButtonView)
barButtonItem.accessibilityLabel = CommonStrings.openSettingsButton
barButtonItem.accessibilityLabel = CommonStrings.openAppSettingsButton
return barButtonItem
}
}

View File

@ -168,7 +168,7 @@ public class LocationPicker: UIViewController {
comment: "Alert body indicating the user has denied location permissions")
)
let openSettingsAction = ActionSheetAction(
title: CommonStrings.openSettingsButton,
title: CommonStrings.openSystemSettingsButton,
style: .default
) { _ in UIApplication.shared.openSystemSettings() }
alert.addAction(openSettingsAction)

View File

@ -4021,9 +4021,6 @@
/* A keyboard command to begin a search on the conversation list. */
"KEY_COMMAND_SEARCH" = "Search";
/* A keyboard command to present the application settings dialog. */
"KEY_COMMAND_SETTINGS" = "Settings";
/* A keyboard command to open the current conversation's sticker picker. */
"KEY_COMMAND_STICKERS" = "Show Stickers";
@ -5164,6 +5161,9 @@
/* Title label for the onboarding verification page */
"ONBOARDING_VERIFICATION_TITLE_LABEL" = "Verification code";
/* Title for button which opens the in-app settings */
"OPEN_APP_SETTINGS_BUTTON" = "Settings";
/* Button text which opens the settings app */
"OPEN_SETTINGS_BUTTON" = "Settings";

View File

@ -115,8 +115,18 @@ public enum CommonStrings {
OWSLocalizedString("SETTINGS_HELP", comment: "Title for help button and help pages in app settings.")
}
static public var openSettingsButton: String {
OWSLocalizedString("OPEN_SETTINGS_BUTTON", comment: "Button text which opens the settings app")
static public var openAppSettingsButton: String {
OWSLocalizedString(
"OPEN_APP_SETTINGS_BUTTON",
comment: "Title for button which opens the in-app settings"
)
}
static public var openSystemSettingsButton: String {
OWSLocalizedString(
"OPEN_SETTINGS_BUTTON",
comment: "Button text which opens the settings app"
)
}
static public var errorAlertTitle: String {

View File

@ -15,9 +15,7 @@ public class AppContextUtils {
return nil
}
return ActionSheetAction(title: CommonStrings.openSettingsButton,
accessibilityIdentifier: "system_settings",
style: .default) { _ in
return ActionSheetAction(title: CommonStrings.openSystemSettingsButton) { _ in
CurrentAppContext().openSystemSettings()
completion?()
}