fix(access-tokens): Use label instead of placeholder in translation

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson 2022-08-14 21:42:23 +02:00
parent f3450d66a9
commit 1cdc8dfeb2
2 changed files with 7 additions and 3 deletions

View file

@ -213,7 +213,7 @@
},
"deleteAccessToken": {
"title": "Really delete token?",
"message": "When deleting an access token, the applications that used it won't have access to your account anymore. You eventually need a new token to continue using those applications.",
"message": "When deleting the access token '{{label}}', the applications that used it won't have access to your account anymore. You eventually need a new token to continue using those applications.",
"notificationTitle": "Access token deleted",
"notificationText": "The access token '{{label}}' has been deleted.",
"failed": "There was an error deleting the access token. Please try it again or contact your instance's administrator."

View file

@ -34,7 +34,11 @@ export const AccessTokenDeletionModal: React.FC<AccessTokenDeletionModalProps> =
return dispatchUiNotification(
'profile.modal.deleteAccessToken.notificationTitle',
'profile.modal.deleteAccessToken.notificationText',
{}
{
contentI18nOptions: {
label: token.label
}
}
)
})
.catch(showErrorNotification('profile.modal.deleteAccessToken.failed'))
@ -48,7 +52,7 @@ export const AccessTokenDeletionModal: React.FC<AccessTokenDeletionModalProps> =
title={'profile.modal.deleteAccessToken.title'}
{...cypressId('access-token-modal-delete')}>
<Modal.Body>
<Trans i18nKey='profile.modal.deleteAccessToken.message' />
<Trans i18nKey='profile.modal.deleteAccessToken.message' values={{ label: token.label }} />
</Modal.Body>
<Modal.Footer>
<Button variant='danger' onClick={onConfirmDelete}>