COVIDSafe code from version 1.6 (#6)

This commit is contained in:
COVIDSafe Support 2020-06-19 17:43:33 +10:00 committed by GitHub
parent 149daee2e9
commit 2063cea613
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 1963 additions and 1664 deletions

View file

@ -46,7 +46,7 @@ class PersonalDetailsViewController: UIViewController, UITextFieldDelegate, UIPi
let toolBar = UIToolbar()
toolBar.sizeToFit()
self.nextBarButtonItem = UIBarButtonItem(title: NSLocalizedString("Done", comment: "Done"),
self.nextBarButtonItem = UIBarButtonItem(title: "Done".localizedString(),
style: .plain,
target: self,
action: #selector(self.nextButtonTapped))
@ -202,7 +202,7 @@ class PersonalDetailsViewController: UIViewController, UITextFieldDelegate, UIPi
func textFieldDidBeginEditing(_ textField: UITextField) {
if (textField == firstnameTextField || textField == postcodeTextField) {
nextBarButtonItem?.title = NSLocalizedString("Done", comment: "Done")
nextBarButtonItem?.title = "Done".localizedString()
if(UIAccessibility.isVoiceOverRunning) {
firstnameTextField.isAccessibilityElement = true
postcodeTextField.isAccessibilityElement = true
@ -232,7 +232,7 @@ class PersonalDetailsViewController: UIViewController, UITextFieldDelegate, UIPi
ageTextField.isAccessibilityElement = false
UIAccessibility.post(notification: .screenChanged, argument: agePicker)
}
nextBarButtonItem?.title = NSLocalizedString("Next", comment: "Next")
nextBarButtonItem?.title = "Next".localizedString()
}
}
@ -270,10 +270,10 @@ class PersonalDetailsViewController: UIViewController, UITextFieldDelegate, UIPi
}
func presentValidationError(error: String, fieldToFocus: UITextField) {
let errorAlert = UIAlertController(title: NSLocalizedString("ValidationError", comment: "Validation error"),
let errorAlert = UIAlertController(title: "ValidationError".localizedString(comment: "Validation error"),
message: error,
preferredStyle: .alert)
errorAlert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: "OK"),
errorAlert.addAction(UIAlertAction(title: "OK".localizedString(),
style: .default,
handler: { _ in
fieldToFocus.becomeFirstResponder()
@ -303,7 +303,7 @@ class PersonalDetailsViewController: UIViewController, UITextFieldDelegate, UIPi
return
}
guard postCode.range(of: #"^(0[2|8|9]|[1-9][0-9])\d{2}$"#, options: .regularExpression) != nil else {
presentValidationError(error: NSLocalizedString("PostcodeValidationErrorMessage", comment: "Please enter a valid postcode"),
presentValidationError(error: "PostcodeValidationErrorMessage".localizedString(comment: "Please enter a valid postcode"),
fieldToFocus: postcodeTextField)
return
}