diff --git a/StripeIdentity/StripeIdentity/Resources/Localizations/en.lproj/Localizable.strings b/StripeIdentity/StripeIdentity/Resources/Localizations/en.lproj/Localizable.strings index 2c3c7ba35b6..7c801ca372c 100644 --- a/StripeIdentity/StripeIdentity/Resources/Localizations/en.lproj/Localizable.strings +++ b/StripeIdentity/StripeIdentity/Resources/Localizations/en.lproj/Localizable.strings @@ -132,6 +132,15 @@ /* Instructional text for scanning a passport */ "Position your passport in the center of the frame" = "Position your passport in the center of the frame"; +/* Label text for previewing user experience */ +"Preview user experience" = "Preview user experience"; + +/* Proceed button text */ +"Proceed" = "Proceed"; + +/* Explains the usages of preview user experience */ +"Proceed to preview as an end user. Information provided will not be verified." = "Proceed to preview as an end user. Information provided will not be verified."; + /* Button text displayed to the user to retake photo */ "Retake Photos" = "Retake Photos"; @@ -178,12 +187,21 @@ /* When selected in an action sheet, opens the device's camera interface */ "Take Photo" = "Take Photo"; +/* Title to terminate mobile SDK flow in test mode */ +"Terminate mobile SDK flow" = "Terminate mobile SDK flow"; + +/* Explains how terminate works. Don't translate Completed, Cancelled and Failed. */ +"Terminate mobile SDK flow locally with Completed, Cancelled or Failed without changing the verification session on server." = "Terminate mobile SDK flow locally with Completed, Cancelled or Failed without changing the verification session on server."; + /* Text for message of warning alert */ "The images of your identity document have not been saved. Do you want to leave?" = "The images of your identity document have not been saved. Do you want to leave?"; /* Error text displayed to the user when the device's camera is not available */ "There was an error accessing the camera." = "There was an error accessing the camera."; +/* Explains the usages of test mode screen. */ +"This page is only shown in testmode." = "This page is only shown in testmode."; + /* Button to attempt to re-scan identity document image */ "Try Again" = "Try Again"; @@ -230,6 +248,9 @@ /* Line 2 of error text displayed to the user if we could not scan a high quality image of the user's identity document in a reasonable amount of time and manually uploading a file is allowed */ "You can either try again or upload an image from your device." = "You can either try again or upload an image from your device."; +/* Title of test mode screen */ +"You're currently in testmode" = "You're currently in testmode"; + /* Text for message of warning alert */ "Your selfie images have not been saved. Do you want to leave?" = "Your selfie images have not been saved. Do you want to leave?"; diff --git a/StripeIdentity/StripeIdentity/Source/Helpers/String+Localized.swift b/StripeIdentity/StripeIdentity/Source/Helpers/String+Localized.swift index ce5d6220d6d..ea3515f29e9 100644 --- a/StripeIdentity/StripeIdentity/Source/Helpers/String+Localized.swift +++ b/StripeIdentity/StripeIdentity/Source/Helpers/String+Localized.swift @@ -147,4 +147,55 @@ extension String.Localized { "Error text displayed to the user when the device's camera is not available" ) } + + // MARK: - Debug View + static var testModeTitle: String { + STPLocalizedString( + "You're currently in testmode", + "Title of test mode screen" + ) + } + + static var testModeContent: String { + STPLocalizedString( + "This page is only shown in testmode.", + "Explains the usages of test mode screen." + ) + } + + static var finishMobileFlow: String { + STPLocalizedString( + "Terminate mobile SDK flow", + "Title to terminate mobile SDK flow in test mode" + ) + } + + static var finishMobileFlowDetails: String { + STPLocalizedString( + "Terminate mobile SDK flow locally with Completed, Cancelled or Failed without changing the verification session on server.", + "Explains how terminate works. Don't translate Completed, Cancelled and Failed." + ) + } + + static var previewUserExperience: String { + STPLocalizedString( + "Preview user experience", + "Label text for previewing user experience" + ) + } + + static var previewUserExperienceDetails: String { + STPLocalizedString( + "Proceed to preview as an end user. Information provided will not be verified.", + "Explains the usages of preview user experience" + ) + } + + static var proceed: String { + STPLocalizedString( + "Proceed", + "Proceed button text" + ) + } + } diff --git a/StripeIdentity/StripeIdentity/Source/NativeComponents/Views/DebugView.swift b/StripeIdentity/StripeIdentity/Source/NativeComponents/Views/DebugView.swift index 037241fbacd..7712c59d39c 100644 --- a/StripeIdentity/StripeIdentity/Source/NativeComponents/Views/DebugView.swift +++ b/StripeIdentity/StripeIdentity/Source/NativeComponents/Views/DebugView.swift @@ -4,6 +4,8 @@ // // Created by Chen Cen on 4/18/23. // + +@_spi(STP) import StripeCore @_spi(STP) import StripeUICore import UIKit @@ -71,7 +73,7 @@ class DebugView: UIView { ]) let titleFirstLine = UILabel() - titleFirstLine.text = "You're currently in testmode" + titleFirstLine.text = .Localized.testModeTitle titleFirstLine.adjustsFontForContentSizeCategory = true titleFirstLine.font = sectionTitleFont @@ -79,7 +81,7 @@ class DebugView: UIView { titleSecondLine.numberOfLines = 0 titleSecondLine.adjustsFontForContentSizeCategory = true titleSecondLine.font = sectionContentFont - titleSecondLine.text = "This page is only shown in testmode." + titleSecondLine.text = .Localized.testModeContent let titleTextVstack = UIStackView(arrangedSubviews: [titleFirstLine, titleSecondLine]) titleTextVstack.axis = .vertical @@ -116,13 +118,13 @@ class DebugView: UIView { let finishMobileFlowFirstLine = UILabel() finishMobileFlowFirstLine.numberOfLines = 0 finishMobileFlowFirstLine.font = sectionTitleFont - finishMobileFlowFirstLine.text = "Terminate mobile SDK flow" + finishMobileFlowFirstLine.text = .Localized.finishMobileFlow vStack.addArrangedSubview(finishMobileFlowFirstLine) let finishMobileFlowSecondLine = UILabel() finishMobileFlowSecondLine.numberOfLines = 0 finishMobileFlowSecondLine.font = sectionContentFont - finishMobileFlowSecondLine.text = "Terminate mobile SDK flow locally with Completed, Cancelled or Failed without changing the verification session on server." + finishMobileFlowSecondLine.text = .Localized.finishMobileFlowDetails vStack.addArrangedSubview(finishMobileFlowSecondLine) vStack.addArrangedSubview( @@ -152,13 +154,13 @@ class DebugView: UIView { private func configurePreviewUserExperienceSection() { let previewFirstLine = UILabel() - previewFirstLine.text = "Preview user experience" + previewFirstLine.text = .Localized.previewUserExperience previewFirstLine.numberOfLines = 0 previewFirstLine.font = sectionTitleFont vStack.addArrangedSubview(previewFirstLine) let previewSecondLine = UILabel() - previewSecondLine.text = "Proceed to preview as an end user. Information provided will not be verified." + previewSecondLine.text = .Localized.previewUserExperienceDetails previewSecondLine.numberOfLines = 0 previewSecondLine.font = sectionContentFont vStack.addArrangedSubview(previewFirstLine) @@ -166,7 +168,7 @@ class DebugView: UIView { vStack.addArrangedSubview( Button( - title: "Preview", + title: .Localized.proceed, target: self, action: #selector(didTapPreview(button:)) ) diff --git a/StripeIdentity/StripeIdentityTests/Snapshot/DebugViewControllerSnapshotTest.swift b/StripeIdentity/StripeIdentityTests/Snapshot/DebugViewControllerSnapshotTest.swift index 74f7980bb36..55db05e6c87 100644 --- a/StripeIdentity/StripeIdentityTests/Snapshot/DebugViewControllerSnapshotTest.swift +++ b/StripeIdentity/StripeIdentityTests/Snapshot/DebugViewControllerSnapshotTest.swift @@ -7,8 +7,8 @@ import Foundation -@testable import StripeIdentity import iOSSnapshotTestCase +@testable import StripeIdentity final class DebugViewControllerSnapshotTest: FBSnapshotTestCase { diff --git a/Tests/ReferenceImages_64/StripeIdentityTests.DebugViewControllerSnapshotTest/testViewIsConfigured@3x.png b/Tests/ReferenceImages_64/StripeIdentityTests.DebugViewControllerSnapshotTest/testViewIsConfigured@3x.png index 54326f2a7d4..15a92433d48 100644 Binary files a/Tests/ReferenceImages_64/StripeIdentityTests.DebugViewControllerSnapshotTest/testViewIsConfigured@3x.png and b/Tests/ReferenceImages_64/StripeIdentityTests.DebugViewControllerSnapshotTest/testViewIsConfigured@3x.png differ