fix: make "DELETE" confirmation work in other languages (#11987)

* Confirm delete i18n

* Make DELETE a parameter
This commit is contained in:
Beto Dealmeida
2020-12-09 14:40:07 -08:00
committed by GitHub
parent 4da47f1635
commit 36976d17f7

View File

@@ -65,7 +65,9 @@ export default function DeleteModal({
>
<DescriptionContainer>{description}</DescriptionContainer>
<StyleFormGroup>
<FormLabel htmlFor="delete">{t('type "delete" to confirm')}</FormLabel>
<FormLabel htmlFor="delete">
{t('Type "%s" to confirm', t('DELETE'))}
</FormLabel>
<FormControl
data-test="delete-modal-input"
id="delete"
@@ -75,7 +77,7 @@ export default function DeleteModal({
event: React.FormEvent<FormControl & FormControlProps>,
) => {
const targetValue = (event.currentTarget?.value as string) ?? '';
setDisableChange(targetValue.toUpperCase() !== 'DELETE');
setDisableChange(targetValue.toUpperCase() !== t('DELETE'));
}}
/>
</StyleFormGroup>