Skip to content

Commit

Permalink
update document translation
Browse files Browse the repository at this point in the history
  • Loading branch information
ccen-stripe committed Jun 21, 2024
1 parent f4cd079 commit 079d8b3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions identity/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<string name="stripe_back_of_dl_selected">Back of driver license is selected</string>
<!-- Description of back of identity card image -->
<string name="stripe_back_of_id">Back of identity card</string>
<!-- Description of back of identity document image -->
<string name="stripe_back_of_id_document">Back of identity document</string>
<!-- Description of the checkmark to indicate back of ID is uploaded, used for A11Y -->
<string name="stripe_back_of_id_selected">Back of ID is selected</string>
<!-- Title displayed when requesting camera permissions -->
Expand Down Expand Up @@ -106,6 +108,8 @@
<string name="stripe_front_of_dl_selected">Front of driver license is selected</string>
<!-- Description of front of identity card image -->
<string name="stripe_front_of_id">Front of identity card</string>
<!-- Description of front of identity document image -->
<string name="stripe_front_of_id_document">Front of identity document</string>
<!-- Description of the checkmark to indicate front of ID is uploaded, used for A11Y -->
<string name="stripe_front_of_id_selected">Front of ID is selected</string>
<!-- Button to go back to the previous screen -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ private fun DocumentCaptureScreen(
}

val title = if (targetScanType.isNullOrFront()) {
stringResource(id = R.string.stripe_front_of_id)
stringResource(id = R.string.stripe_front_of_id_document)
} else {
stringResource(id = R.string.stripe_back_of_id)
stringResource(id = R.string.stripe_back_of_id_document)
}

Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ internal fun UploadImageDialog(
end = 24.dp
),
text = stringResource(
id = if (isFront) R.string.stripe_front_of_id else R.string.stripe_back_of_id
id = if (isFront) R.string.stripe_front_of_id_document else R.string.stripe_back_of_id_document
),
style = MaterialTheme.typography.subtitle1,
fontWeight = FontWeight.Bold
Expand Down Expand Up @@ -389,7 +389,9 @@ private fun SingleSideUploadRow(
horizontalArrangement = Arrangement.SpaceBetween
) {
Text(
text = stringResource(id = if (isFront) R.string.stripe_front_of_id else R.string.stripe_back_of_id),
text = stringResource(
id = if (isFront) R.string.stripe_front_of_id_document else R.string.stripe_back_of_id_document
),
modifier = Modifier.align(CenterVertically)
)
when (uploadUiState) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class DocumentScanScreenTest {
testDocumentScanScreen(
scannerState = IdentityScanViewModel.State.Scanning(),
) {
onNodeWithTag(SCAN_TITLE_TAG).assertTextEquals(context.getString(R.string.stripe_front_of_id))
onNodeWithTag(SCAN_TITLE_TAG).assertTextEquals(context.getString(R.string.stripe_front_of_id_document))
onNodeWithTag(SCAN_MESSAGE_TAG).assertTextEquals(context.getString(R.string.stripe_position_id_front))
onNodeWithTag(CHECK_MARK_TAG).assertDoesNotExist()
onNodeWithTag(CONTINUE_BUTTON_TAG).onChildAt(0).assertIsNotEnabled()
Expand All @@ -114,7 +114,7 @@ class DocumentScanScreenTest {
eq(IdentityScanState.ScanType.DOC_FRONT),
any()
)
onNodeWithTag(SCAN_TITLE_TAG).assertTextEquals(context.getString(R.string.stripe_front_of_id))
onNodeWithTag(SCAN_TITLE_TAG).assertTextEquals(context.getString(R.string.stripe_front_of_id_document))
onNodeWithTag(SCAN_MESSAGE_TAG).assertTextEquals(context.getString(R.string.stripe_hold_still))
onNodeWithTag(CHECK_MARK_TAG).assertDoesNotExist()
onNodeWithTag(CONTINUE_BUTTON_TAG).onChildAt(0).assertIsNotEnabled()
Expand All @@ -133,7 +133,7 @@ class DocumentScanScreenTest {
eq(IdentityScanState.ScanType.DOC_BACK),
any()
)
onNodeWithTag(SCAN_TITLE_TAG).assertTextEquals(context.getString(R.string.stripe_back_of_id))
onNodeWithTag(SCAN_TITLE_TAG).assertTextEquals(context.getString(R.string.stripe_back_of_id_document))
onNodeWithTag(SCAN_MESSAGE_TAG).assertTextEquals(context.getString(R.string.stripe_hold_still))
onNodeWithTag(CHECK_MARK_TAG).assertDoesNotExist()
onNodeWithTag(CONTINUE_BUTTON_TAG).onChildAt(0).assertIsNotEnabled()
Expand All @@ -148,7 +148,7 @@ class DocumentScanScreenTest {
messageId = R.string.stripe_scanned
) {
verify(mockDocumentScanViewModel).stopScan(any())
onNodeWithTag(SCAN_TITLE_TAG).assertTextEquals(context.getString(R.string.stripe_front_of_id))
onNodeWithTag(SCAN_TITLE_TAG).assertTextEquals(context.getString(R.string.stripe_front_of_id_document))
onNodeWithTag(SCAN_MESSAGE_TAG).assertTextEquals(context.getString(R.string.stripe_scanned))
onNodeWithTag(CHECK_MARK_TAG).assertExists()
onNodeWithTag(CONTINUE_BUTTON_TAG).onChildAt(0).assertIsEnabled()
Expand Down

0 comments on commit 079d8b3

Please sign in to comment.