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] 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;