Skip to content

Commit

Permalink
Fix mozilla#2791 Make sure all <Localized> instances have default con…
Browse files Browse the repository at this point in the history
…tent (mozilla#2890)
  • Loading branch information
fzzzy authored and lmorchard committed Sep 27, 2017
1 parent 9796496 commit c17175c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion frontend/src/app/components/ExperimentDisableDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default class ExperimentDisableDialog extends React.Component {
<div id="disabled-feedback-modal" className="modal feedback-modal modal-bounce-in">
<header className="modal-header-wrapper">
<Localized id="feedbackUninstallTitle" $title={ experiment.title }>
<h3 className="modal-header" />
<h3 className="modal-header">Thank You!</h3>
</Localized>
<div className="modal-cancel" onClick={e => this.cancel(e)} />
</header>
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/app/components/ExperimentEolDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@ export default class ExperimentEolDialog extends React.Component {
<form>
<div className="modal-content">
<Localized id="eolDisableMessage" $title={title}>
<p className="centered"></p>
<p className="centered">
The {title} experiment has ended. Once you uninstall it you won&apos;t be able to re-install it through Test Pilot again.
</p>
</Localized>
</div>
<div className="modal-actions">
<Localized id="disableExperiment" $title={title}>
<button onClick={e => this.proceed(e)} className="submit button warning large"></button>
<button onClick={e => this.proceed(e)} className="submit button warning large">
Disable {title}
</button>
</Localized>
</div>
</form>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/components/ExperimentPreFeedbackDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class ExperimentPreFeedbackDialog extends React.Component {
<div className={classnames('modal', 'tour-modal')}>
<header className="modal-header-wrapper">
<Localized id="experimentPreFeedbackTitle" $title={experiment.title}>
<h3 className="modal-header"></h3>
<h3 className="modal-header">{experiment.title} feedback</h3>
</Localized>
<div className="modal-cancel" onClick={e => this.cancel(e)}/>
</header>
Expand All @@ -38,7 +38,7 @@ export default class ExperimentPreFeedbackDialog extends React.Component {
<div className="tour-text">
<Localized id="experimentPreFeedbackLinkCopy" $title={experiment.title}>
<a onClick={e => this.feedback(e)}
href={surveyURL}></a>
href={surveyURL}>Give feedback about the {experiment.title} experiment</a>
</Localized>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/app/components/ExperimentRowCard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ export default class ExperimentRowCard extends React.Component {
>
<div className="experiment-actions">
{enabled && <Localized id="experimentListEnabledTab">
<div className="tab enabled-tab"></div>
<div className="tab enabled-tab">Enabled</div>
</Localized>}
{this.justLaunched() && <Localized id="experimentListJustLaunchedTab">
<div className="tab just-launched-tab"></div>
<div className="tab just-launched-tab">Just Launched</div>
</Localized>}
{this.justUpdated() && <Localized id="experimentListJustUpdatedTab">
<div className="tab just-updated-tab"></div>
<div className="tab just-updated-tab">Just Updated</div>
</Localized>}
</div>
<div className={`experiment-icon-wrapper-${experiment.slug} experiment-icon-wrapper`}>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/components/ExperimentTourDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default class ExperimentTourDialog extends React.Component {

const headerTitle = enabled ? (
<Localized id="tourOnboardingTitle" $title={experiment.title}>
<h3 className="modal-header"></h3>
<h3 className="modal-header">{experiment.title} enabled!</h3>
</Localized>) : (<h3 className="modal-header">{experiment.title}</h3>);

return (
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/app/components/NewsletterForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ export default class NewsletterForm extends React.Component {
<input name={fieldName} id={fieldName} type="checkbox" checked={this.props.privacy} required
onChange={this.handlePrivacyClick} onClick={this.handlePrivacyClick} />
{ this.state.privacyNote ? <Localized id="newsletterFormPrivacyAgreementRequired">
<span></span>
<span>
Please check this box if you want to proceed.
</span>
</Localized> : null }
<LocalizedHtml id="newsletterFormPrivacyNotice">
<span>
Expand Down
16 changes: 8 additions & 8 deletions frontend/src/app/containers/ExperimentPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export class ExperimentDetail extends React.Component {
</Localized>
</h2>
<Localized id="experimentPromoSubheader">
<p className="banner__copy"></p>
<p className="banner__copy">We&apos;re building next-generation features for Firefox. Install Test Pilot to try them!</p>
</Localized>
<MainInstallButton {...this.props}
experimentTitle={title}
Expand All @@ -281,7 +281,7 @@ export class ExperimentDetail extends React.Component {
<span>{title} is enabled.</span>
</Localized>}
{(statusType === 'error') && <Localized id="installErrorMessage" $title={ title }>
<span><span></span></span>
<span>Uh oh. {title} could not be enabled. Try again later.</span>
</Localized>}
</div>
<LayoutWrapper helperClass="details-header" flexModifier="row-between-breaking">
Expand Down Expand Up @@ -399,7 +399,7 @@ export class ExperimentDetail extends React.Component {
</ul>
</div>
{privacy_notice_url && <Localized id="experimentPrivacyNotice" $title={title}>
<a className="privacy-policy" href={privacy_notice_url}><span></span></a>
<a className="privacy-policy" href={privacy_notice_url}>You can learn more about the data collection for {title} here.</a>
</Localized>}
</section>}
</div>
Expand Down Expand Up @@ -650,7 +650,7 @@ export class ExperimentDetail extends React.Component {
return (
<div className="upgrade-notice">
<Localized id="upgradeNoticeTitle" $title={title} $min_release={min_release}>
<div></div>
<div>{title} requires Firefox {min_release} or later.</div>
</Localized>
<Localized id="upgradeNoticeLink">
<a onClick={e => this.clickUpgradeNotice(e)} href="https://support.mozilla.org/kb/find-what-version-firefox-you-are-using" target="_blank" rel="noopener noreferrer">How to update Firefox.</a>
Expand All @@ -666,7 +666,7 @@ export class ExperimentDetail extends React.Component {
return (
<div className="upgrade-notice">
<Localized id="versionChangeNotice" $experiment_title={title}>
<div></div>
<div>{title} is not supported in this version of Firefox.</div>
</Localized>
<Localized id="versionChangeNoticeLink">
<a onClick={e => this.clickUpgradeNotice(e)} href="https://www.mozilla.org/firefox/" target="_blank" rel="noopener noreferrer">Get the current version of Firefox.</a>
Expand Down Expand Up @@ -710,7 +710,7 @@ export class ExperimentDetail extends React.Component {
<span className="transition-text">Disabling...</span>
</Localized>
<Localized id="disableExperiment" $title={title}>
<span className="default-text"></span>
<span className="default-text">Disable {title}</span>
</Localized>
</button>
</div>
Expand All @@ -722,7 +722,7 @@ export class ExperimentDetail extends React.Component {
return <div className="experiment-controls">
<button disabled onClick={e => { e.preventDefault(); }} style={{ minWidth: progressButtonWidth }} id="install-button" className={classnames(['button', 'default'])}>
<Localized id="experimentManuallyDisabled" $title={title}>
<span className="default-text"></span>
<span className="default-text">{title} disabled in Add-ons Manager</span>
</Localized>
</button>
</div>;
Expand All @@ -737,7 +737,7 @@ export class ExperimentDetail extends React.Component {
<span className="transition-text">Disabling...</span>
</Localized>
<Localized id="disableExperiment" $title={title}>
<span className="default-text"></span>
<span className="default-text">Disable {title}</span>
</Localized>
</button>
</div>;
Expand Down

0 comments on commit c17175c

Please sign in to comment.