New registration: show correct charset switcher text on PIN screen

We shouldn't say things like "Create alphanumeric PIN" if you're
entering an existing PIN.
This commit is contained in:
Evan Hahn 2023-03-27 12:37:40 -05:00 committed by GitHub
parent f1378081e6
commit 1b358ac179
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -370,16 +370,8 @@ class RegistrationPinViewController: OWSViewController {
switch pinCharacterSet {
case .digitsOnly:
pinTextField.keyboardType = .numberPad
togglePinCharacterSetButton.setTitle(title: OWSLocalizedString(
"PIN_CREATION_CREATE_ALPHANUMERIC",
comment: "Button asking if the user would like to create an alphanumeric PIN"
))
case .alphanumeric:
pinTextField.keyboardType = .default
togglePinCharacterSetButton.setTitle(title: OWSLocalizedString(
"PIN_CREATION_CREATE_NUMERIC",
comment: "Button asking if the user would like to create an numeric PIN"
))
}
if previousKeyboardType != pinTextField.keyboardType {
pinTextField.reloadInputViews()
@ -435,11 +427,19 @@ class RegistrationPinViewController: OWSViewController {
"PIN_CREATION_NUMERIC_HINT",
comment: "Label indicating the user must use at least 4 digits"
)
togglePinCharacterSetButton.setTitle(title: OWSLocalizedString(
"PIN_CREATION_CREATE_ALPHANUMERIC",
comment: "Button asking if the user would like to create an alphanumeric PIN"
))
case .alphanumeric:
pinValidationLabel.text = OWSLocalizedString(
"PIN_CREATION_ALPHANUMERIC_HINT",
comment: "Label indicating the user must use at least 4 characters"
)
togglePinCharacterSetButton.setTitle(title: OWSLocalizedString(
"PIN_CREATION_CREATE_NUMERIC",
comment: "Button asking if the user would like to create an numeric PIN"
))
}
pinValidationLabel.textColor = .colorForRegistrationExplanationLabel
@ -498,6 +498,19 @@ class RegistrationPinViewController: OWSViewController {
needHelpWithExistingPinButton.setTitleColor(Theme.accentBlueColor)
switch pinCharacterSet {
case .digitsOnly:
togglePinCharacterSetButton.setTitle(title: OWSLocalizedString(
"ONBOARDING_2FA_ENTER_ALPHANUMERIC",
comment: "Button asking if the user would like to enter an alphanumeric PIN"
))
case .alphanumeric:
togglePinCharacterSetButton.setTitle(title: OWSLocalizedString(
"ONBOARDING_2FA_ENTER_NUMERIC",
comment: "Button asking if the user would like to enter an numeric PIN"
))
}
replaceViewsAfterTextField(with: [
pinValidationLabel,
needHelpWithExistingPinButton,