Commit 7a6e5c3e authored by Ray Schamp's avatar Ray Schamp

Fix student registration localization

Add missing strings, actually translate the content of the steps
parent 6144c6f8
...@@ -742,13 +742,9 @@ module.exports = { ...@@ -742,13 +742,9 @@ module.exports = {
); );
} }
})), })),
ClassInviteStep: React.createClass({ ClassInviteStep: intl.injectIntl(React.createClass({
getDefaultProps: function () { getDefaultProps: function () {
return { return {
messages: {
'general.getStarted': 'Get Started',
'registration.classroomInviteStepDescription': 'has invited you to join the class:'
},
waiting: false waiting: false
}; };
}, },
...@@ -756,6 +752,7 @@ module.exports = { ...@@ -756,6 +752,7 @@ module.exports = {
this.props.onNextStep(); this.props.onNextStep();
}, },
render: function () { render: function () {
var formatMessage = this.props.intl.formatMessage;
return ( return (
<Slide className="registration-step class-invite-step"> <Slide className="registration-step class-invite-step">
{this.props.waiting ? [ {this.props.waiting ? [
...@@ -765,7 +762,7 @@ module.exports = { ...@@ -765,7 +762,7 @@ module.exports = {
src={this.props.classroom.educator.profile.images['50x50']} />, src={this.props.classroom.educator.profile.images['50x50']} />,
<h2>{this.props.classroom.educator.username}</h2>, <h2>{this.props.classroom.educator.username}</h2>,
<p className="description"> <p className="description">
{this.props.messages['registration.classroomInviteStepDescription']} {formatMessage({id: 'registration.classroomInviteStepDescription'})}
</p>, </p>,
<Card> <Card>
<div className="contents"> <div className="contents">
...@@ -774,24 +771,17 @@ module.exports = { ...@@ -774,24 +771,17 @@ module.exports = {
</div> </div>
<NextStepButton onClick={this.onNextStep} <NextStepButton onClick={this.onNextStep}
waiting={this.props.waiting} waiting={this.props.waiting}
text={this.props.messages['general.getStarted']} /> text={formatMessage({id: 'general.getStarted'})} />
</Card>, </Card>,
<StepNavigation steps={this.props.totalSteps - 1} active={this.props.activeStep} /> <StepNavigation steps={this.props.totalSteps - 1} active={this.props.activeStep} />
]} ]}
</Slide> </Slide>
); );
} }
}), })),
ClassWelcomeStep: React.createClass({ ClassWelcomeStep: intl.injectIntl(React.createClass({
getDefaultProps: function () { getDefaultProps: function () {
return { return {
messages: {
'registration.goToClass': 'Go to Class',
'registration.welcomeStepDescription': 'You have successfully set up a Scratch account! ' +
'You are now a member of the class:',
'registration.welcomeStepPrompt': 'To get started, click on the button below.',
'registration.welcomeStepTitle': 'Hurray! Welcome to Scratch!'
},
waiting: false waiting: false
}; };
}, },
...@@ -799,32 +789,33 @@ module.exports = { ...@@ -799,32 +789,33 @@ module.exports = {
this.props.onNextStep(); this.props.onNextStep();
}, },
render: function () { render: function () {
var formatMessage = this.props.intl.formatMessage;
return ( return (
<Slide className="registration-step class-welcome-step"> <Slide className="registration-step class-welcome-step">
{this.props.waiting ? [ {this.props.waiting ? [
<Spinner /> <Spinner />
] : [ ] : [
<h2>{this.props.messages['registration.welcomeStepTitle']}</h2>, <h2>{formatMessage({id: 'registration.welcomeStepTitle'})}</h2>,
<p className="description">{this.props.messages['registration.welcomeStepDescription']}</p>, <p className="description">{formatMessage({id: 'registration.welcomeStepDescription'})}</p>,
<Card> <Card>
{this.props.classroom ? ( {this.props.classroom ? (
<div className="contents"> <div className="contents">
<h3>{this.props.classroom.title}</h3> <h3>{this.props.classroom.title}</h3>
<img className="class-image" src={this.props.classroom.images['250x150']} /> <img className="class-image" src={this.props.classroom.images['250x150']} />
<p>{this.props.messages['registration.welcomeStepPrompt']}</p> <p>{formatMessage({id: 'registration.welcomeStepPrompt'})}</p>
</div> </div>
) : ( ) : (
null null
)} )}
<NextStepButton onClick={this.onNextStep} <NextStepButton onClick={this.onNextStep}
waiting={this.props.waiting} waiting={this.props.waiting}
text={this.props.messages['registration.goToClass']} /> text={formatMessage({id: 'registration.goToClass'})} />
</Card> </Card>
]} ]}
</Slide> </Slide>
); );
} }
}), })),
RegistrationError: intl.injectIntl(React.createClass({ RegistrationError: intl.injectIntl(React.createClass({
render: function () { render: function () {
return ( return (
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
"general.forParents": "For Parents", "general.forParents": "For Parents",
"general.forEducators": "For Educators", "general.forEducators": "For Educators",
"general.forDevelopers": "For Developers", "general.forDevelopers": "For Developers",
"general.getStarted": "Get Started",
"general.gender": "Gender", "general.gender": "Gender",
"general.guidelines": "Community Guidelines", "general.guidelines": "Community Guidelines",
"general.help": "Help", "general.help": "Help",
...@@ -107,6 +108,7 @@ ...@@ -107,6 +108,7 @@
"registration.checkOutResources": "Get Started with Resources", "registration.checkOutResources": "Get Started with Resources",
"registration.checkOutResourcesDescription": "Explore materials for educators and facilitators written by the Scratch Team, including <a href='/educators#resources'>tips, tutorials, and guides</a>.", "registration.checkOutResourcesDescription": "Explore materials for educators and facilitators written by the Scratch Team, including <a href='/educators#resources'>tips, tutorials, and guides</a>.",
"registration.classroomInviteStepDescription": "has invited you to join the class:",
"registration.confirmYourEmail": "Confirm Your Email", "registration.confirmYourEmail": "Confirm Your Email",
"registration.confirmYourEmailDescription": "If you haven't already, please click the link in the confirmation email sent to:", "registration.confirmYourEmailDescription": "If you haven't already, please click the link in the confirmation email sent to:",
"registration.createUsername": "Create a Username", "registration.createUsername": "Create a Username",
......
...@@ -103,7 +103,6 @@ var StudentRegistration = intl.injectIntl(React.createClass({ ...@@ -103,7 +103,6 @@ var StudentRegistration = intl.injectIntl(React.createClass({
: :
<Progression {... this.state}> <Progression {... this.state}>
<Steps.ClassInviteStep classroom={this.state.classroom} <Steps.ClassInviteStep classroom={this.state.classroom}
messages={this.props.messages}
onNextStep={this.advanceStep} onNextStep={this.advanceStep}
waiting={this.state.waiting || !this.state.classroom} /> waiting={this.state.waiting || !this.state.classroom} />
<Steps.UsernameStep onNextStep={this.advanceStep} <Steps.UsernameStep onNextStep={this.advanceStep}
...@@ -116,7 +115,6 @@ var StudentRegistration = intl.injectIntl(React.createClass({ ...@@ -116,7 +115,6 @@ var StudentRegistration = intl.injectIntl(React.createClass({
onNextStep={this.register} onNextStep={this.register}
waiting={this.state.waiting} /> waiting={this.state.waiting} />
<Steps.ClassWelcomeStep classroom={this.state.classroom} <Steps.ClassWelcomeStep classroom={this.state.classroom}
messages={this.props.messages}
onNextStep={this.goToClass} onNextStep={this.goToClass}
waiting={this.state.waiting || !this.state.classroom} /> waiting={this.state.waiting || !this.state.classroom} />
</Progression> </Progression>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment