Update key naming on the email confirmation dialogs

This commit is contained in:
Georgi Angelov 2024-08-21 13:01:23 +03:00
parent 9072c849d2
commit b1ac5e27bb
6 changed files with 29 additions and 41 deletions

View file

@ -8,8 +8,12 @@ const FormattedMessage = require('react-intl').FormattedMessage;
const EmailConfirmationModal = require('../../../components/modal/email-confirmation/modal.jsx');
const EmailConfirmationBanner = ({onRequestDismiss, userUsesParentEmail}) => {
const [showEmailConfirmationModal, setShowEmailConfirmationModal] = useState(false);
const i18nPrefix =
userUsesParentEmail ?
"emailConfirmationBanner.parentEmail" :
"emailConfirmationBanner";
return (
<React.Fragment>
{(showEmailConfirmationModal && <EmailConfirmationModal
@ -25,11 +29,7 @@ const EmailConfirmationBanner = ({onRequestDismiss, userUsesParentEmail}) => {
onRequestDismiss={onRequestDismiss}
>
<FormattedMessage
id={
userUsesParentEmail ?
"emailConfirmationBanner.under13.confirm" :
"emailConfirmationBanner.confirm"
}
id={`${i18nPrefix}.confirm`}
values={{
confirmLink: (
<a
@ -39,24 +39,12 @@ const EmailConfirmationBanner = ({onRequestDismiss, userUsesParentEmail}) => {
setShowEmailConfirmationModal(true);
}}
>
<FormattedMessage
id={
userUsesParentEmail ?
"emailConfirmationBanner.under13.confirmLinkText" :
"emailConfirmationBanner.confirmLinkText"
}
/>
<FormattedMessage id={`${i18nPrefix}.confirmLinkText`} />
</a>
),
faqLink: (
<a href="/faq/#accounts">
<FormattedMessage
id={
userUsesParentEmail ?
"emailConfirmationBanner.under13.faqLinkText" :
"emailConfirmationBanner.faqLinkText"
}
/>
<FormattedMessage id={`${i18nPrefix}.faqLinkText`} />
</a>
)
}}

View file

@ -77,7 +77,7 @@ class WelcomeStep extends React.Component {
<FormattedMessage
id={
this.props.under13 ?
"registration.welcomeStepInstructionsUnder13" :
"registration.under13.welcomeStepInstructions" :
"registration.welcomeStepInstructions"
}
values={{

View file

@ -17,7 +17,7 @@ const EmailConfirmationModal = ({
const i18nPrefix =
userUsesParentEmail ?
'emailConfirmationModal.under13' :
'emailConfirmationModal.parentEmail' :
'emailConfirmationModal';
return (

View file

@ -263,7 +263,7 @@
"registration.welcomeStepDescription": "You have successfully set up a Scratch account! You are now a member of the class:",
"registration.welcomeStepDescriptionNonEducator": "Youre now logged in! You can start exploring and creating projects.",
"registration.welcomeStepInstructions": "Want to share and comment? Click the link on the email we sent to {email}.",
"registration.welcomeStepInstructionsUnder13": "Your parent/guardian needs to confirm your account within 10 days or you will lose access to Scratch. They need to click the link on the email we sent to {email}.",
"registration.under13.welcomeStepInstructions": "Your parent/guardian needs to confirm your account within 10 days or you will lose access to Scratch. They need to click the link on the email we sent to {email}.",
"registration.welcomeStepPrompt": "To get started, click on the button below.",
"registration.welcomeStepTitle": "Hurray! Welcome to Scratch!",
"registration.welcomeStepTitleNonEducator": "Welcome to Scratch, {username}!",
@ -272,9 +272,9 @@
"emailConfirmationBanner.confirmLinkText": "Confirm your email",
"emailConfirmationBanner.faqLinkText": "Having trouble?",
"emailConfirmationBanner.under13.confirm": "A parent/guardian needs to {confirmLink} within 10 days of registration. {faqLink}",
"emailConfirmationBanner.under13.confirmLinkText": "confirm your account",
"emailConfirmationBanner.under13.faqLinkText": "Having trouble?",
"emailConfirmationBanner.parentEmail.confirm": "A parent/guardian needs to {confirmLink} within 10 days of registration. {faqLink}",
"emailConfirmationBanner.parentEmail.confirmLinkText": "confirm your account",
"emailConfirmationBanner.parentEmail.faqLinkText": "Having trouble?",
"emailConfirmationModal.confirm": "Confirm your email",
"emailConfirmationModal.wantToShare": "Want to share on Scratch?",
@ -290,19 +290,19 @@
"emailConfirmationModal.havingTrouble": "Having Trouble? {tipsLink}",
"emailConfirmationModal.checkOutTips": "Check out these tips",
"emailConfirmationModal.under13.confirm": "Confirm your account",
"emailConfirmationModal.under13.wantToShare": "Want to share on Scratch?",
"emailConfirmationModal.under13.clickEmailLink": "Your parent/guardian needs to confirm your email address by clicking the link in the email we sent to:",
"emailConfirmationModal.under13.resendEmail": "Resend confirmation email",
"emailConfirmationModal.under13.confirmingTips": "Tips for confirming your email address",
"emailConfirmationModal.under13.tipWaitTenMinutes": "Wait for ten minutes. The email may take a while to arrive.",
"emailConfirmationModal.under13.tipCheckSpam": "Check your spam folder.",
"emailConfirmationModal.under13.correctEmail": "Make sure your parent's email address is correct, see {accountSettings}.",
"emailConfirmationModal.under13.accountSettings": "Account Settings",
"emailConfirmationModal.under13.wantMoreInfo": "Want more information? {FAQLink}",
"emailConfirmationModal.under13.checkOutFAQ": "Check out the FAQ",
"emailConfirmationModal.under13.havingTrouble": "Having Trouble? {tipsLink}",
"emailConfirmationModal.under13.checkOutTips": "Check out these tips",
"emailConfirmationModal.parentEmail.confirm": "Confirm your account",
"emailConfirmationModal.parentEmail.wantToShare": "Want to share on Scratch?",
"emailConfirmationModal.parentEmail.clickEmailLink": "Your parent/guardian needs to confirm your email address by clicking the link in the email we sent to:",
"emailConfirmationModal.parentEmail.resendEmail": "Resend confirmation email",
"emailConfirmationModal.parentEmail.confirmingTips": "Tips for confirming your email address",
"emailConfirmationModal.parentEmail.tipWaitTenMinutes": "Wait for ten minutes. The email may take a while to arrive.",
"emailConfirmationModal.parentEmail.tipCheckSpam": "Check your spam folder.",
"emailConfirmationModal.parentEmail.correctEmail": "Make sure your parent's email address is correct, see {accountSettings}.",
"emailConfirmationModal.parentEmail.accountSettings": "Account Settings",
"emailConfirmationModal.parentEmail.wantMoreInfo": "Want more information? {FAQLink}",
"emailConfirmationModal.parentEmail.checkOutFAQ": "Check out the FAQ",
"emailConfirmationModal.parentEmail.havingTrouble": "Having Trouble? {tipsLink}",
"emailConfirmationModal.parentEmail.checkOutTips": "Check out these tips",
"thumbnail.by": "by",
"report.error": "Something went wrong when trying to send your message. Please try again.",

View file

@ -1039,7 +1039,7 @@ const mapStateToProps = state => {
state.session.session.flags.has_outstanding_email_confirmation &&
state.session.session.flags.confirm_email_banner;
const isTotallyNormal = state.session.session.flags && selectIsTotallyNormal(state);
const userUsesParentEmail = state.session.session.flags && !!state.session.session.flags.with_parent_email;
const userUsesParentEmail = state.session.session.flags && state.session.session.flags.with_parent_email;
// if we don't have projectInfo, assume it's shared until we know otherwise
const isShared = !projectInfoPresent || state.preview.projectInfo.is_published;

View file

@ -190,7 +190,7 @@ class Splash extends React.Component {
const showIntro = this.shouldShowIntro() || false;
const showWelcome = this.shouldShowWelcome();
const homepageRefreshStatus = this.getHomepageRefreshStatus();
const userUsesParentEmail = this.props.flags && !!this.props.flags.with_parent_email;
const userUsesParentEmail = this.props.flags && this.props.flags.with_parent_email;
return (
<SplashPresentation