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