Skip to content

Commit

Permalink
Remove hardcoded plan name (#91324)
Browse files Browse the repository at this point in the history
  • Loading branch information
niranjan-uma-shankar authored May 31, 2024
1 parent eecdd83 commit c6bb647
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
PLAN_ECOMMERCE_2_YEARS,
PLAN_ECOMMERCE_3_YEARS,
PLAN_ECOMMERCE_MONTHLY,
getPlan,
getPlans,
} from '@automattic/calypso-products';
import page from '@automattic/calypso-router';
Expand Down Expand Up @@ -196,11 +197,25 @@ export function EntrepreneurPlan( props: EntrepreneurPlanProps ) {
<Card>
<div className="plan-wrapper">
<div className="plan-description">
<h3 className="entrepreneur-trial-plan__plan-title">{ translate( 'Entrepreneur' ) }</h3>
<h3 className="entrepreneur-trial-plan__plan-title">
{ getPlan( PLAN_ECOMMERCE )?.getTitle() ?? '' }
</h3>
<p className="card-text">
{ translate(
"Secure the full benefits of the Entrepreneur plan. Purchase today and maximize your store's potential!"
) }
{ isEnglish ||
hasTranslation(
"Secure the full benefits of the %(planName)s plan. Purchase today and maximize your store's potential!"
)
? translate(
"Secure the full benefits of the %(planName)s plan. Purchase today and maximize your store's potential!",
{
args: {
planName: getPlan( PLAN_ECOMMERCE )?.getTitle() ?? '',
},
}
)
: translate(
"Secure the full benefits of the Entrepreneur plan. Purchase today and maximize your store's potential!"
) }
</p>
</div>
<div className="price-block">
Expand Down
11 changes: 8 additions & 3 deletions client/my-sites/plans/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
getIntervalTypeForTerm,
getPlan,
isFreePlanProduct,
PLAN_ECOMMERCE,
PLAN_ECOMMERCE_TRIAL_MONTHLY,
PLAN_FREE,
PLAN_HOSTING_TRIAL_MONTHLY,
Expand Down Expand Up @@ -401,15 +402,19 @@ class Plans extends Component {
);

const hasEntrepreneurTrialSubHeaderTextTranslation = hasTranslation(
"Discover what's available in your Entrepreneur plan."
"Discover what's available in your %(planName)s plan."
);

const isEnglishLocale = englishLocales.includes( this.props.locale );

const entrepreneurTrialSubHeaderText =
isEnglishLocale || hasEntrepreneurTrialSubHeaderTextTranslation
? translate( "Discover what's available in your Entrepreneur plan." )
: translate( "Discover what's available in your Entrepreneur plan" );
? translate( "Discover what's available in your %(planName)s plan.", {
args: {
planName: getPlan( PLAN_ECOMMERCE )?.getTitle() ?? '',
},
} )
: translate( "Discover what's available in your Entrepreneur plan." );

const isWooExpressTrial = purchase?.isWooExpressTrial;

Expand Down

0 comments on commit c6bb647

Please sign in to comment.