From b10a38667522b31decb878e869b9b41bedee4457 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 22 Apr 2020 21:37:52 +0100 Subject: [PATCH 1/2] Fix i18n of SSO UIA copy in Deactivate Account Dialog Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .../views/dialogs/DeactivateAccountDialog.js | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/components/views/dialogs/DeactivateAccountDialog.js b/src/components/views/dialogs/DeactivateAccountDialog.js index 3889f0989a..b269ec2fdb 100644 --- a/src/components/views/dialogs/DeactivateAccountDialog.js +++ b/src/components/views/dialogs/DeactivateAccountDialog.js @@ -26,30 +26,6 @@ import { _t } from '../../../languageHandler'; import InteractiveAuth, {ERROR_USER_CANCELLED} from "../../structures/InteractiveAuth"; import {DEFAULT_PHASE, PasswordAuthEntry, SSOAuthEntry} from "../auth/InteractiveAuthEntryComponents"; -const dialogAesthetics = { - [SSOAuthEntry.PHASE_PREAUTH]: { - body: _t("Confirm your account deactivation by using Single Sign On to prove your identity."), - continueText: _t("Single Sign On"), - continueKind: "danger", - }, - [SSOAuthEntry.PHASE_POSTAUTH]: { - body: _t("Are you sure you want to deactivate your account? This is irreversible."), - continueText: _t("Confirm account deactivation"), - continueKind: "danger", - }, -}; - -// This is the same as aestheticsForStagePhases in InteractiveAuthDialog minus the `title` -const DEACTIVATE_AESTHETICS = { - [SSOAuthEntry.LOGIN_TYPE]: dialogAesthetics, - [SSOAuthEntry.UNSTABLE_LOGIN_TYPE]: dialogAesthetics, - [PasswordAuthEntry.LOGIN_TYPE]: { - [DEFAULT_PHASE]: { - body: _t("To continue, please enter your password:"), - }, - }, -}; - export default class DeactivateAccountDialog extends React.Component { constructor(props) { super(props); @@ -84,6 +60,30 @@ export default class DeactivateAccountDialog extends React.Component { } _onStagePhaseChange = (stage, phase) => { + const dialogAesthetics = { + [SSOAuthEntry.PHASE_PREAUTH]: { + body: _t("Confirm your account deactivation by using Single Sign On to prove your identity."), + continueText: _t("Single Sign On"), + continueKind: "danger", + }, + [SSOAuthEntry.PHASE_POSTAUTH]: { + body: _t("Are you sure you want to deactivate your account? This is irreversible."), + continueText: _t("Confirm account deactivation"), + continueKind: "danger", + }, + }; + + // This is the same as aestheticsForStagePhases in InteractiveAuthDialog minus the `title` + const DEACTIVATE_AESTHETICS = { + [SSOAuthEntry.LOGIN_TYPE]: dialogAesthetics, + [SSOAuthEntry.UNSTABLE_LOGIN_TYPE]: dialogAesthetics, + [PasswordAuthEntry.LOGIN_TYPE]: { + [DEFAULT_PHASE]: { + body: _t("To continue, please enter your password:"), + }, + }, + }; + const aesthetics = DEACTIVATE_AESTHETICS[stage]; let bodyText = null; let continueText = null; From bc690c8f17f7eff0854757f78b2928cccdc18e2b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 22 Apr 2020 21:41:30 +0100 Subject: [PATCH 2/2] i18n Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/i18n/strings/en_EN.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 7af45003a8..5634dc8b5b 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1580,12 +1580,12 @@ "You've previously used a newer version of Riot on %(host)s. To use this version again with end to end encryption, you will need to sign out and back in again. ": "You've previously used a newer version of Riot on %(host)s. To use this version again with end to end encryption, you will need to sign out and back in again. ", "Incompatible Database": "Incompatible Database", "Continue With Encryption Disabled": "Continue With Encryption Disabled", + "Server did not require any authentication": "Server did not require any authentication", + "Server did not return valid authentication information.": "Server did not return valid authentication information.", "Confirm your account deactivation by using Single Sign On to prove your identity.": "Confirm your account deactivation by using Single Sign On to prove your identity.", "Are you sure you want to deactivate your account? This is irreversible.": "Are you sure you want to deactivate your account? This is irreversible.", "Confirm account deactivation": "Confirm account deactivation", "To continue, please enter your password:": "To continue, please enter your password:", - "Server did not require any authentication": "Server did not require any authentication", - "Server did not return valid authentication information.": "Server did not return valid authentication information.", "There was a problem communicating with the server. Please try again.": "There was a problem communicating with the server. Please try again.", "This will make your account permanently unusable. You will not be able to log in, and no one will be able to re-register the same user ID. This will cause your account to leave all rooms it is participating in, and it will remove your account details from your identity server. This action is irreversible.": "This will make your account permanently unusable. You will not be able to log in, and no one will be able to re-register the same user ID. This will cause your account to leave all rooms it is participating in, and it will remove your account details from your identity server. This action is irreversible.", "Deactivating your account does not by default cause us to forget messages you have sent. If you would like us to forget your messages, please tick the box below.": "Deactivating your account does not by default cause us to forget messages you have sent. If you would like us to forget your messages, please tick the box below.",