Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
/* Instructional text for scanning back of a identity card */
"Flip your identity card over to the other side" = "Flip your identity card over to the other side";

/* Instructional text when the opposite side of the ID is shown */
"Incorrect side detected, flip document over" = "Incorrect side detected, flip document over";

/* Accessibility label when front driver's license, passport, or government issued photo id photo has successfully uploaded */
"Front %@ photo successfully uploaded" = "Front %@ photo successfully uploaded";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ extension String.Localized {
)
}

static var incorrect_side_flip: String {
return STPLocalizedString(
"Incorrect side detected, flip document over",
"Instructional text when the opposite side of the ID is shown"
)
}

static var position_in_center_identity_card: String {
return STPLocalizedString(
"Position your identity document in the center of the frame",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,15 @@ extension DocumentCaptureViewController {
let zoomLevel = idDetectorOutput.computeZoomLevel()
switch (side, matchesClassification, zoomLevel) {
case (.front, false, _), (.back, false, _):
return scanningTextWithNoInput(availableIDTypes: availableIDTypes, for: side)
// If wrong side is shown, provide explicit flip guidance
switch (side, foundClassification) {
case (.front, .idCardBack):
return String.Localized.incorrect_side_flip
case (.back, .idCardFront), (.back, .passport):
return String.Localized.incorrect_side_flip
default:
return scanningTextWithNoInput(availableIDTypes: availableIDTypes, for: side)
}
case (_, true, .ok):
return String.Localized.scanning
case (_, true, .tooClose):
Expand Down