Skip to content

Commit

Permalink
regression: E2EE modal translation (#29900)
Browse files Browse the repository at this point in the history
  • Loading branch information
yash-rajpal authored Jul 24, 2023
1 parent 5858cac commit 212be17
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changeset/giant-chairs-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Fix End to End Encryption modal translation
6 changes: 0 additions & 6 deletions apps/meteor/app/e2e/client/rocketchat.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,6 @@ class E2E extends Emitter {

const randomPassword = Meteor._localStorage.getItem('e2e.randomPassword');
if (randomPassword) {
const passwordRevealText = t('E2E_password_reveal_text', {
postProcess: 'sprintf',
sprintf: [randomPassword],
});

this.openAlert({
title: () => t('Save_your_encryption_password'),
html: () => t('Click_here_to_view_and_copy_your_password'),
Expand All @@ -221,7 +216,6 @@ class E2E extends Emitter {
imperativeModal.open({
component: SaveE2EPasswordModal,
props: {
passwordRevealText,
randomPassword,
onClose: imperativeModal.close,
onCancel: () => {
Expand Down
11 changes: 2 additions & 9 deletions apps/meteor/client/views/e2e/SaveE2EPasswordModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,13 @@ import React from 'react';
import GenericModal from '../../components/GenericModal';

type SaveE2EPasswordModalProps = {
passwordRevealText: string;
randomPassword: string;
onClose: () => void;
onCancel: () => void;
onConfirm: () => void;
};

const SaveE2EPasswordModal = ({
passwordRevealText,
randomPassword,
onClose,
onCancel,
onConfirm,
}: SaveE2EPasswordModalProps): ReactElement => {
const SaveE2EPasswordModal = ({ randomPassword, onClose, onCancel, onConfirm }: SaveE2EPasswordModalProps): ReactElement => {
const t = useTranslation();
const { copy, hasCopied } = useClipboard(randomPassword);

Expand All @@ -35,7 +28,7 @@ const SaveE2EPasswordModal = ({
title={t('Save_your_encryption_password')}
>
<>
<Box dangerouslySetInnerHTML={{ __html: passwordRevealText }} />
<Box dangerouslySetInnerHTML={{ __html: t('E2E_password_reveal_text', { randomPassword }) }} />
<Button disabled={hasCopied} small mbs='x24' onClick={() => copy()}>
{hasCopied ? t('Copied') : t('Copy_password')}
</Button>
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1727,7 +1727,7 @@
"E2E_key_reset_email": "E2E Key Reset Notification",
"E2E_message_encrypted_placeholder": "This message is end-to-end encrypted. To view it, you must enter your encryption key in your account settings.",
"E2E_password_request_text": "To access your encrypted private groups and direct messages, enter your encryption password. <br/>You need to enter this password to encode/decode your messages on every client you use, since the key is not stored on the server.",
"E2E_password_reveal_text": "Create secure private rooms and direct messages with end-to-end encryption.<br/><br/>Save your password securely, as the key to encode/decode your messages won't be saved on the server. You'll need to enter it on other devices to use e2e encryption. <a href=\"https://rocket.chat/docs/user-guides/end-to-end-encryption/\" target=\"_blank\">Learn more</a><br/><br/>Change your password anytime from any browser you've entered it on. Remember to store your password before dismissing this message.<br/><br/>Your password is: <span style=\"font-weight: bold;\">%s</span>",
"E2E_password_reveal_text": "Create secure private rooms and direct messages with end-to-end encryption.<br/><br/>Save your password securely, as the key to encode/decode your messages won't be saved on the server. You'll need to enter it on other devices to use e2e encryption. <a href=\"https://rocket.chat/docs/user-guides/end-to-end-encryption/\" target=\"_blank\">Learn more</a><br/><br/>Change your password anytime from any browser you've entered it on. Remember to store your password before dismissing this message.<br/><br/>Your password is: <span style=\"font-weight: bold;\">{{randomPassword}}</span>",
"E2E_Reset_Email_Content": "You've been automatically logged out. When you login again, Rocket.Chat will generate a new key and restore your access to any encrypted room that has one or more members online. Due to the nature of the E2E encryption, Rocket.Chat will not be able to restore access to any encrypted room that has no member online.",
"E2E_Reset_Key_Explanation": "This option will remove your current E2E key and log you out. <BR/>When you login again, Rocket.Chat will generate you a new key and restore your access to any encrypted room that has one or more members online.<BR/>Due to the nature of the E2E encryption, Rocket.Chat will not be able to restore access to any encrypted room that has no member online.",
"E2E_Reset_Other_Key_Warning": "Reset the current E2E key will log out the user. When the user login again, Rocket.Chat will generate a new key and restore the user access to any encrypted room that has one or more members online. Due to the nature of the E2E encryption, Rocket.Chat will not be able to restore access to any encrypted room that has no member online.",
Expand Down

0 comments on commit 212be17

Please sign in to comment.