Update strings for the verification dialog (#30880)
* Change 'Verify Session' to 'Start Verification' * Update strings for the verification dialog This completes the Element Web part of https://github.com/element-hq/element-meta/issues/2898 * fixup! Update strings for the verification dialog Remove separate _unsent string
This commit is contained in:
@@ -8,6 +8,7 @@ Please see LICENSE files in the repository root for full details.
|
||||
|
||||
import React from "react";
|
||||
import { VerificationPhase, VerificationRequestEvent, type VerificationRequest } from "matrix-js-sdk/src/crypto-api";
|
||||
import { VerificationMethod } from "matrix-js-sdk/src/types";
|
||||
import { type User } from "matrix-js-sdk/src/matrix";
|
||||
|
||||
import { MatrixClientPeg } from "../../../MatrixClientPeg";
|
||||
@@ -111,10 +112,27 @@ export default class VerificationRequestDialog extends React.Component<IProps, I
|
||||
|
||||
private dialogTitle(request?: VerificationRequest): string {
|
||||
if (request?.isSelfVerification) {
|
||||
if (request.phase === VerificationPhase.Cancelled) {
|
||||
return _t("encryption|verification|verification_dialog_title_failed");
|
||||
} else {
|
||||
return _t("encryption|verification|verification_dialog_title_device");
|
||||
switch (request.phase) {
|
||||
case VerificationPhase.Ready:
|
||||
return _t("encryption|verification|verification_dialog_title_choose");
|
||||
case VerificationPhase.Done:
|
||||
return _t("encryption|verification|verification_dialog_title_verified");
|
||||
case VerificationPhase.Started:
|
||||
switch (request.chosenMethod) {
|
||||
case VerificationMethod.Reciprocate:
|
||||
return _t("encryption|verification|verification_dialog_title_confirm_green_shield");
|
||||
case VerificationMethod.Sas:
|
||||
return _t("encryption|verification|verification_dialog_title_compare_emojis");
|
||||
default:
|
||||
return _t("encryption|verification|verification_dialog_title_device");
|
||||
}
|
||||
case VerificationPhase.Unsent:
|
||||
case VerificationPhase.Requested:
|
||||
return _t("encryption|verification|verification_dialog_title_start_on_other_device");
|
||||
case VerificationPhase.Cancelled:
|
||||
return _t("encryption|verification|verification_dialog_title_failed");
|
||||
default:
|
||||
return _t("encryption|verification|verification_dialog_title_device");
|
||||
}
|
||||
} else {
|
||||
return _t("encryption|verification|verification_dialog_title_user");
|
||||
|
||||
@@ -43,7 +43,7 @@ const EncryptionInfo: React.FC<IProps> = ({
|
||||
}: IProps) => {
|
||||
let content: JSX.Element;
|
||||
if (waitingForOtherParty && isSelfVerification) {
|
||||
content = <div>{_t("encryption|verification|self_verification_hint")}</div>;
|
||||
content = <div>{_t("encryption|verification|once_accepted_can_continue")}</div>;
|
||||
} else if (waitingForOtherParty || waitingForNetwork) {
|
||||
let text: string;
|
||||
if (waitingForOtherParty) {
|
||||
|
||||
@@ -126,7 +126,7 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||
) : null;
|
||||
return (
|
||||
<div>
|
||||
{_t("encryption|verification|qr_or_sas_header")}
|
||||
{_t("encryption|verification|verify_by_completing_one_of")}
|
||||
<div className="mx_VerificationPanel_QRPhase_startOptions">
|
||||
{qrBlockDialog}
|
||||
{or}
|
||||
@@ -224,7 +224,7 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||
private renderQRReciprocatePhase(): JSX.Element {
|
||||
const { member, request } = this.props;
|
||||
const description = request.isSelfVerification
|
||||
? _t("encryption|verification|qr_reciprocate_same_shield_device")
|
||||
? _t("encryption|verification|qr_reciprocate_check_again_device")
|
||||
: _t("encryption|verification|qr_reciprocate_same_shield_user", {
|
||||
displayName: (member as User).displayName || (member as RoomMember).name || member.userId,
|
||||
});
|
||||
@@ -236,19 +236,18 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||
<p>{description}</p>
|
||||
<E2EIcon isUser={true} status={E2EStatus.Verified} size={128} hideTooltip={true} />
|
||||
<div className="mx_VerificationPanel_reciprocateButtons">
|
||||
<AccessibleButton
|
||||
kind="danger"
|
||||
disabled={this.state.reciprocateButtonClicked}
|
||||
onClick={this.onReciprocateNoClick}
|
||||
>
|
||||
{_t("action|no")}
|
||||
</AccessibleButton>
|
||||
<AccessibleButton
|
||||
kind="primary"
|
||||
disabled={this.state.reciprocateButtonClicked}
|
||||
onClick={this.onReciprocateYesClick}
|
||||
>
|
||||
{_t("action|yes")}
|
||||
{_t("encryption|verification|qr_reciprocate_yes")}
|
||||
</AccessibleButton>
|
||||
<AccessibleButton
|
||||
disabled={this.state.reciprocateButtonClicked}
|
||||
onClick={this.onReciprocateNoClick}
|
||||
>
|
||||
{_t("encryption|verification|qr_reciprocate_no")}
|
||||
</AccessibleButton>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
@@ -260,12 +259,7 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||
</p>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div className="mx_UserInfo_container mx_VerificationPanel_reciprocate_section">
|
||||
<h3>{_t("encryption|verification|scan_qr")}</h3>
|
||||
{body}
|
||||
</div>
|
||||
);
|
||||
return <div className="mx_UserInfo_container mx_VerificationPanel_reciprocate_section">{body}</div>;
|
||||
}
|
||||
|
||||
private renderVerifiedPhase(): JSX.Element {
|
||||
@@ -282,18 +276,7 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||
|
||||
let description: string;
|
||||
if (request.isSelfVerification) {
|
||||
const device = this.state.otherDeviceDetails;
|
||||
if (!device) {
|
||||
// This can happen if the device is logged out while we're still showing verification
|
||||
// UI for it.
|
||||
logger.warn("Verified device we don't know about: " + this.props.request.otherDeviceId);
|
||||
description = _t("encryption|verification|successful_own_device");
|
||||
} else {
|
||||
description = _t("encryption|verification|successful_device", {
|
||||
deviceName: device.displayName,
|
||||
deviceId: device.deviceId,
|
||||
});
|
||||
}
|
||||
description = _t("encryption|verification|now_you_can");
|
||||
} else {
|
||||
description = _t("encryption|verification|successful_user", {
|
||||
displayName: (member as User).displayName || (member as RoomMember).name || member.userId,
|
||||
@@ -313,35 +296,9 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||
}
|
||||
|
||||
private renderCancelledPhase(): JSX.Element {
|
||||
const { member, request } = this.props;
|
||||
|
||||
let startAgainInstruction: string;
|
||||
if (request.isSelfVerification) {
|
||||
startAgainInstruction = _t("encryption|verification|prompt_self");
|
||||
} else {
|
||||
startAgainInstruction = _t("encryption|verification|prompt_user");
|
||||
}
|
||||
|
||||
let text: string;
|
||||
if (request.cancellationCode === "m.timeout") {
|
||||
text = _t("encryption|verification|timed_out") + ` ${startAgainInstruction}`;
|
||||
} else if (request.cancellingUserId === request.otherUserId) {
|
||||
if (request.isSelfVerification) {
|
||||
text = _t("encryption|verification|cancelled_self");
|
||||
} else {
|
||||
text = _t("encryption|verification|cancelled_user", {
|
||||
displayName: (member as User).displayName || (member as RoomMember).name || member.userId,
|
||||
});
|
||||
}
|
||||
text = `${text} ${startAgainInstruction}`;
|
||||
} else {
|
||||
text = _t("encryption|verification|cancelled") + ` ${startAgainInstruction}`;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="mx_UserInfo_container">
|
||||
<h3>{_t("common|verification_cancelled")}</h3>
|
||||
<p>{text}</p>
|
||||
<p>{_t("encryption|verification|cancelled_verification")}</p>
|
||||
|
||||
<AccessibleButton kind="primary" className="mx_UserInfo_wideButton" onClick={this.props.onClose}>
|
||||
{_t("action|got_it")}
|
||||
|
||||
@@ -177,7 +177,7 @@ export default class VerificationRequestToast extends React.PureComponent<IProps
|
||||
detail={detail}
|
||||
primaryLabel={
|
||||
request.isSelfVerification || !request.roomId
|
||||
? _t("encryption|verification|request_toast_accept")
|
||||
? _t("encryption|verification|request_toast_start_verification")
|
||||
: _t("encryption|verification|request_toast_accept_user")
|
||||
}
|
||||
onPrimaryClick={this.accept}
|
||||
|
||||
@@ -119,7 +119,7 @@ export default class VerificationShowSas extends React.Component<IProps, IState>
|
||||
</div>
|
||||
);
|
||||
sasCaption = this.props.isSelf
|
||||
? _t("encryption|verification|sas_emoji_caption_self")
|
||||
? _t("encryption|verification|confirm_the_emojis")
|
||||
: _t("encryption|verification|sas_emoji_caption_user");
|
||||
} else if (this.props.sas.decimal) {
|
||||
const numberBlocks = this.props.sas.decimal.map((num, i) => <span key={i}>{num}</span>);
|
||||
|
||||
+14
-14
@@ -598,7 +598,6 @@
|
||||
"user": "User",
|
||||
"user_avatar": "Profile picture",
|
||||
"username": "Username",
|
||||
"verification_cancelled": "Verification cancelled",
|
||||
"verified": "Verified",
|
||||
"version": "Version",
|
||||
"video": "Video",
|
||||
@@ -993,9 +992,7 @@
|
||||
"skip_verification": "Skip verification for now",
|
||||
"verify_this_device": "Verify this device"
|
||||
},
|
||||
"cancelled": "You cancelled verification.",
|
||||
"cancelled_self": "You cancelled verification on your other device.",
|
||||
"cancelled_user": "%(displayName)s cancelled verification.",
|
||||
"cancelled_verification": "Either the request timed out, the request was denied, or there was a verification mismatch.",
|
||||
"cancelling": "Cancelling…",
|
||||
"cant_confirm": "Can't confirm?",
|
||||
"complete_action": "Got It",
|
||||
@@ -1003,6 +1000,7 @@
|
||||
"complete_title": "Verified!",
|
||||
"confirm_identity_description": "Verify this device to set up secure messaging",
|
||||
"confirm_identity_title": "Confirm your identity",
|
||||
"confirm_the_emojis": "Confirm that the emojis below match those shown on your other device.",
|
||||
"error_starting_description": "We were unable to start a chat with the other user.",
|
||||
"error_starting_title": "Error starting verification",
|
||||
"explainer": "Secure messages with this user are end-to-end encrypted and not able to be read by third parties.",
|
||||
@@ -1029,36 +1027,32 @@
|
||||
"wrong_fingerprint": "Unable to verify device '%(deviceId)s' - the supplied fingerprint '%(fingerprint)s' does not match the device fingerprint, '%(fprint)s'"
|
||||
},
|
||||
"no_support_qr_emoji": "The device you are trying to verify doesn't support scanning a QR code or emoji verification, which is what %(brand)s supports. Try with a different client.",
|
||||
"now_you_can": "Now you can read or send messages securely, and anyone you chat with can also trust this device.",
|
||||
"once_accepted_can_continue": "Once accepted you'll be able to continue with the verification.",
|
||||
"other_party_cancelled": "The other party cancelled the verification.",
|
||||
"prompt_encrypted": "Verify all users in a room to ensure it's secure.",
|
||||
"prompt_self": "Start verification again from the notification.",
|
||||
"prompt_unencrypted": "In encrypted rooms, verify all users to ensure it's secure.",
|
||||
"prompt_user": "Start verification again from their profile.",
|
||||
"qr_or_sas": "%(qrCode)s or %(emojiCompare)s",
|
||||
"qr_or_sas_header": "Verify this device by completing one of the following:",
|
||||
"qr_prompt": "Scan this unique code",
|
||||
"qr_reciprocate_same_shield_device": "Almost there! Is your other device showing the same shield?",
|
||||
"qr_reciprocate_check_again_device": "Check again on your other device to finish verification.",
|
||||
"qr_reciprocate_no": "No, I don't see a green shield",
|
||||
"qr_reciprocate_same_shield_user": "Almost there! Is %(displayName)s showing the same shield?",
|
||||
"request_toast_accept": "Verify Session",
|
||||
"qr_reciprocate_yes": "Yes, I see a green shield",
|
||||
"request_toast_accept_user": "Verify User",
|
||||
"request_toast_decline_counter": "Ignore (%(counter)s)",
|
||||
"request_toast_detail": "%(deviceId)s from %(ip)s",
|
||||
"request_toast_start_verification": "Start Verification",
|
||||
"sas_caption_self": "Verify this device by confirming the following number appears on its screen.",
|
||||
"sas_caption_user": "Verify this user by confirming the following number appears on their screen.",
|
||||
"sas_description": "Compare a unique set of emoji if you don't have a camera on either device",
|
||||
"sas_emoji_caption_self": "Confirm the emoji below are displayed on both devices, in the same order:",
|
||||
"sas_emoji_caption_user": "Verify this user by confirming the following emoji appear on their screen.",
|
||||
"sas_match": "They match",
|
||||
"sas_no_match": "They don't match",
|
||||
"sas_prompt": "Compare unique emoji",
|
||||
"scan_qr": "Verify by scanning",
|
||||
"scan_qr_explainer": "Ask %(displayName)s to scan your code:",
|
||||
"self_verification_hint": "To proceed, please accept the verification request on your other device.",
|
||||
"start_button": "Start Verification",
|
||||
"successful_device": "You've successfully verified %(deviceName)s (%(deviceId)s)!",
|
||||
"successful_own_device": "You've successfully verified your device!",
|
||||
"successful_user": "You've successfully verified %(displayName)s!",
|
||||
"timed_out": "Verification timed out.",
|
||||
"unsupported_method": "Unable to find a supported verification method.",
|
||||
"unverified_session_toast_accept": "Yes, it was me",
|
||||
"unverified_session_toast_title": "New login. Was this you?",
|
||||
@@ -1067,12 +1061,18 @@
|
||||
"unverified_sessions_toast_title": "You have unverified sessions",
|
||||
"use_another_device": "Use another device",
|
||||
"use_recovery_key": "Use recovery key",
|
||||
"verification_dialog_title_choose": "Choose how to verify",
|
||||
"verification_dialog_title_compare_emojis": "Compare emojis",
|
||||
"verification_dialog_title_confirm_green_shield": "Confirm that you see a green shield on your other device",
|
||||
"verification_dialog_title_device": "Verify other device",
|
||||
"verification_dialog_title_failed": "Verification failed",
|
||||
"verification_dialog_title_start_on_other_device": "Start verification on the other device",
|
||||
"verification_dialog_title_user": "Verification Request",
|
||||
"verification_dialog_title_verified": "Device verified",
|
||||
"verification_skip_warning": "Without verifying, you won't have access to all your messages and may appear as untrusted to others.",
|
||||
"verification_success_with_backup": "Your new device is now verified. It has access to your encrypted messages, and other users will see it as trusted.",
|
||||
"verification_success_without_backup": "Your new device is now verified. Other users will see it as trusted.",
|
||||
"verify_by_completing_one_of": "Verify by completing one of the following:",
|
||||
"verify_emoji": "Verify by emoji",
|
||||
"verify_emoji_prompt": "Verify by comparing unique emoji.",
|
||||
"verify_emoji_prompt_qr": "If you can't scan the code above, verify by comparing unique emoji.",
|
||||
|
||||
Reference in New Issue
Block a user