Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback untranslated title, subtitle and plan CTA copy #62402

Merged
merged 1 commit into from
Mar 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions client/my-sites/plans-comparison/plans-comparison-action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '@automattic/calypso-products';
import { Button } from '@automattic/components';
import classNames from 'classnames';
import { useTranslate } from 'i18n-calypso';
import i18n, { useTranslate } from 'i18n-calypso';
import { useCallback } from 'react';
import type { WPComPlan } from '@automattic/calypso-products';
import type { TranslateResult } from 'i18n-calypso';
Expand All @@ -35,7 +35,9 @@ function getButtonText( props: Partial< Props >, translate: TranslateFunc ): Tra
const planSlug = plan?.getStoreSlug();

if ( planSlug === PLAN_WPCOM_PRO ) {
return translate( 'Start with Pro' );
return 'en' === i18n.getLocaleSlug() || i18n.hasTranslation( 'Start with Pro' )
? translate( 'Start with Pro' )
: translate( 'Try Pro risk-free' );
} else if ( planSlug === PLAN_FREE || planSlug === PLAN_WPCOM_FLEXIBLE ) {
return translate( 'Start with Free' );
}
Expand Down
15 changes: 10 additions & 5 deletions client/signup/steps/plans/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getUrlParts } from '@automattic/calypso-url';
import { Button } from '@automattic/components';
import { isDesktop, subscribeIsDesktop } from '@automattic/viewport';
import classNames from 'classnames';
import { localize } from 'i18n-calypso';
import i18n, { localize } from 'i18n-calypso';
import PropTypes from 'prop-types';
import { parse as parseQs } from 'qs';
import { Component } from 'react';
Expand Down Expand Up @@ -276,10 +276,12 @@ export class PlansStep extends Component {
}

getHeaderText() {
const { headerText, translate, eligibleForProPlan } = this.props;
const { headerText, translate, eligibleForProPlan, locale } = this.props;

if ( eligibleForProPlan ) {
return translate( 'Choose your hosting plan' );
return 'en' === locale || i18n.hasTranslation( 'Choose your hosting plan' )
? translate( 'Choose your hosting plan' )
: translate( 'Choose the plan that’s right for you' );
}

if ( this.state.isDesktop ) {
Expand All @@ -290,10 +292,13 @@ export class PlansStep extends Component {
}

getSubHeaderText() {
const { hideFreePlan, subHeaderText, translate, eligibleForProPlan } = this.props;
const { hideFreePlan, subHeaderText, translate, eligibleForProPlan, locale } = this.props;

if ( eligibleForProPlan ) {
return translate( 'The WordPress Pro plan comes with a 14-day money back guarantee' );
return 'en' === locale ||
i18n.hasTranslation( 'he WordPress Pro plan comes with a 14-day money back guarantee' )
? translate( 'The WordPress Pro plan comes with a 14-day money back guarantee' )
: translate( 'The WordPress Pro plan comes with a 14-day full money back guarantee' );
}

if ( ! hideFreePlan ) {
Expand Down