refactor: Improve i18n for extension

This commit is contained in:
Myzel394 2023-03-05 11:33:09 +01:00
parent 012d78f8ed
commit 126eb58c96
No known key found for this signature in database
GPG Key ID: 79CC92F37B3E1A2B
2 changed files with 19 additions and 11 deletions

View File

@ -0,0 +1,12 @@
{
"sharePassword": {
"title": "Share Password?",
"description": "An extension is asking for your password. Do you want to share it? Only continue if you initiated this action.",
"warning": "THIS WILL SHARE YOUR PASSWORD WITH THE EXTENSION. ALL YOUR DATA CAN BE DECRYPTED USING IT. ONLY CONTINUE IF YOU TRUST THE EXTENSION AND IF YOU INITIATED THIS REQUEST.",
"sharePassword": "Share Password",
"doNotShare": "Do not share",
"decideLater": "Decide later",
"doNotAskAgain": "Do not ask again"
}
}

View File

@ -25,32 +25,28 @@ export default function PasswordShareConfirmationDialog({
onShare, onShare,
onClose, onClose,
}: PasswordShareConfirmationDialogProps): ReactElement { }: PasswordShareConfirmationDialogProps): ReactElement {
const {t} = useTranslation() const {t} = useTranslation("extension")
return ( return (
<Dialog open={open} onClose={() => onClose(false)} maxWidth="sm" fullWidth={false}> <Dialog open={open} onClose={() => onClose(false)} maxWidth="sm" fullWidth={false}>
<DialogTitle>{t("components.passwordShareConfirmationDialog.title")}</DialogTitle> <DialogTitle>{t("sharePassword.title")}</DialogTitle>
<DialogContent> <DialogContent>
<DialogContentText> <DialogContentText>{t("sharePassword.description")}</DialogContentText>
{t("components.passwordShareConfirmationDialog.description")}
</DialogContentText>
<Box my={2}> <Box my={2}>
<Alert severity="warning"> <Alert severity="warning">{t("sharePassword.warning")}</Alert>
{t("components.passwordShareConfirmationDialog.warning")}
</Alert>
</Box> </Box>
</DialogContent> </DialogContent>
<DialogActions> <DialogActions>
<Box mr="auto"> <Box mr="auto">
<Button startIcon={<MdAccessTimeFilled />} onClick={() => onClose(false)}> <Button startIcon={<MdAccessTimeFilled />} onClick={() => onClose(false)}>
{t("components.passwordShareConfirmationDialog.decideLater")} {t("sharePassword.decideLater")}
</Button> </Button>
</Box> </Box>
<Button startIcon={<TiCancel />} onClick={() => onClose(true)}> <Button startIcon={<TiCancel />} onClick={() => onClose(true)}>
{t("components.passwordShareConfirmationDialog.doNotShare")} {t("sharePassword.doNotAskAgain")}
</Button> </Button>
<Button color="error" onClick={onShare} startIcon={<MdShield />}> <Button color="error" onClick={onShare} startIcon={<MdShield />}>
{t("components.passwordShareConfirmationDialog.continueAction")} {t("sharePassword.sharePassword")}
</Button> </Button>
</DialogActions> </DialogActions>
</Dialog> </Dialog>