diff --git a/client/blocks/importer/wordpress/upgrade-plan/index.tsx b/client/blocks/importer/wordpress/upgrade-plan/index.tsx index 15e50bf4b703a1..6b9451f839e53b 100644 --- a/client/blocks/importer/wordpress/upgrade-plan/index.tsx +++ b/client/blocks/importer/wordpress/upgrade-plan/index.tsx @@ -3,7 +3,7 @@ import { isEnabled } from '@automattic/calypso-config'; import { getPlan, PLAN_BUSINESS } from '@automattic/calypso-products'; import { Button } from '@automattic/components'; import { SiteDetails } from '@automattic/data-stores'; -import { useIsEnglishLocale } from '@automattic/i18n-utils'; +import { useHasEnTranslation, useIsEnglishLocale } from '@automattic/i18n-utils'; import { Title, SubTitle, NextButton } from '@automattic/onboarding'; import { useTranslate } from 'i18n-calypso'; import React, { useEffect } from 'react'; @@ -30,6 +30,7 @@ export const UpgradePlan: React.FunctionComponent< Props > = ( props: Props ) => const translate = useTranslate(); const isEnglishLocale = useIsEnglishLocale(); const plan = getPlan( PLAN_BUSINESS ); + const hasEnTranslation = useHasEnTranslation(); const { site, navigateToVerifyEmailStep, @@ -116,6 +117,21 @@ export const UpgradePlan: React.FunctionComponent< Props > = ( props: Props ) => ); }; + const upgradeCtaCopy = hasEnTranslation( + 'Migrations are exclusive to the %(planName)s plan. Check out all its benefits, and upgrade to get started.' + ) + ? translate( + 'Migrations are exclusive to the %(planName)s plan. Check out all its benefits, and upgrade to get started.', + { + args: { + planName: plan?.getTitle() ?? '', + }, + } + ) + : translate( + 'Migrations are exclusive to the Creator plan. Check out all its benefits, and upgrade to get started.' + ); + return (
{ ! hideTitleAndSubTitle && ( @@ -127,9 +143,7 @@ export const UpgradePlan: React.FunctionComponent< Props > = ( props: Props ) => { subTitleText || isEnglishLocale - ? translate( - 'Migrations are exclusive to the Creator plan. Check out all its benefits, and upgrade to get started.' - ) + ? upgradeCtaCopy : translate( 'Migrating themes, plugins, users, and settings requires a %(plan)s plan.', { diff --git a/client/dev-tools/components/dev-tools.tsx b/client/dev-tools/components/dev-tools.tsx index 9675383dfc1c4b..a61fcaa2055e2e 100644 --- a/client/dev-tools/components/dev-tools.tsx +++ b/client/dev-tools/components/dev-tools.tsx @@ -1,6 +1,7 @@ -import { FEATURE_SFTP } from '@automattic/calypso-products'; +import { FEATURE_SFTP, getPlan, PLAN_BUSINESS } from '@automattic/calypso-products'; import page from '@automattic/calypso-router'; import { Card, Dialog } from '@automattic/components'; +import { useHasEnTranslation } from '@automattic/i18n-utils'; import { Button } from '@wordpress/components'; import { translate } from 'i18n-calypso'; import { useRef, useState } from 'react'; @@ -44,6 +45,7 @@ const DevTools = () => { isSiteAtomic: isSiteWpcomAtomic( state, siteId as number ), hasSftpFeature: siteHasFeature( state, siteId, FEATURE_SFTP ), } ) ); + const hasEnTranslation = useHasEnTranslation(); const upgradeLink = `https://wordpress.com/checkout/${ encodeURIComponent( siteSlug ) }/business`; const pluginsLink = `https://wordpress.com/plugins/${ encodeURIComponent( siteSlug ) }`; @@ -101,6 +103,19 @@ const DevTools = () => { return; } + const upgradeCtaCopy = hasEnTranslation( + 'Upgrade to the %(planName)s plan or higher to get access to all developer tools' + ) + ? translate( + 'Upgrade to the %(planName)s plan or higher to get access to all developer tools', + { + args: { + planName: getPlan( PLAN_BUSINESS )?.getTitle() ?? '', + }, + } + ) + : translate( 'Upgrade to the Creator plan or higher to get access to all developer tools' ); + return (
@@ -114,9 +129,7 @@ const DevTools = () => { ? translate( 'Your plan includes all the developer tools listed below. Click "Activate Now" to begin.' ) - : translate( - 'Upgrade to the Creator plan or higher to get access to all developer tools' - ) } + : upgradeCtaCopy }

{ showActivationButton ? ( <> diff --git a/client/landing/stepper/declarative-flow/internals/components/migration-assistance-modal/index.tsx b/client/landing/stepper/declarative-flow/internals/components/migration-assistance-modal/index.tsx index c63c8bf3bfe76d..ac336908ec353a 100644 --- a/client/landing/stepper/declarative-flow/internals/components/migration-assistance-modal/index.tsx +++ b/client/landing/stepper/declarative-flow/internals/components/migration-assistance-modal/index.tsx @@ -1,4 +1,6 @@ import { recordTracksEvent } from '@automattic/calypso-analytics'; +import { getPlan, PLAN_BUSINESS } from '@automattic/calypso-products'; +import { useHasEnTranslation } from '@automattic/i18n-utils'; import { useEffect } from '@wordpress/element'; import { useTranslate } from 'i18n-calypso'; import ConfirmModal from 'calypso/blocks/importer/components/confirm-modal'; @@ -46,6 +48,8 @@ export const MigrationAssistanceModal: React.FunctionComponent< MigrationAssista } ); }, [ importSiteHostName ] ); + const hasEnTranslation = useHasEnTranslation(); + return (

- { translate( - `Subscribe to the Creator plan now, and get a complimentary migration service (normally $500) to move %(importSiteHostName)s to WordPress.com.`, - { - args: { - importSiteHostName, - }, - } - ) } + { hasEnTranslation( + 'Subscribe to the %(planName)s plan now, and get a complimentary migration service (normally $500) to move %(importSiteHostName)s to WordPress.com.' + ) + ? translate( + 'Subscribe to the %(planName)s plan now, and get a complimentary migration service (normally $500) to move %(importSiteHostName)s to WordPress.com.', + { + args: { + importSiteHostName, + planName: getPlan( PLAN_BUSINESS )?.getTitle() ?? '', + }, + } + ) + : translate( + `Subscribe to the Creator plan now, and get a complimentary migration service (normally $500) to move %(importSiteHostName)s to WordPress.com.`, + { + args: { + importSiteHostName, + }, + } + ) }

{ translate( diff --git a/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-import-or-migrate/index.tsx b/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-import-or-migrate/index.tsx index 508805db084210..1706725db0976e 100644 --- a/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-import-or-migrate/index.tsx +++ b/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-import-or-migrate/index.tsx @@ -1,3 +1,5 @@ +import { getPlan, PLAN_BUSINESS } from '@automattic/calypso-products'; +import { useHasEnTranslation } from '@automattic/i18n-utils'; import { NextButton, StepContainer, @@ -18,9 +20,14 @@ type SubmitDestination = 'import' | 'migrate' | 'upgrade'; const SiteMigrationImportOrMigrate: Step = function ( { navigation } ) { const translate = useTranslate(); const site = useSite(); + const hasEnTranslation = useHasEnTranslation(); const options = [ { - label: translate( 'Everything (requires a Creator Plan)' ), + label: hasEnTranslation( 'Everything (requires a %(planName)s Plan)' ) + ? translate( 'Everything (requires a %(planName)s Plan)', { + args: { planName: getPlan( PLAN_BUSINESS )?.getTitle() ?? '' }, + } ) + : translate( 'Everything (requires a Creator Plan)' ), description: translate( "All your site's content, themes, plugins, users, and customizations." ), diff --git a/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/index.tsx b/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/index.tsx index f6142f6bc74f63..0995086f72057d 100644 --- a/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/index.tsx +++ b/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/index.tsx @@ -4,6 +4,7 @@ import { getPlan, getPlanByPathSlug, } from '@automattic/calypso-products'; +import { useHasEnTranslation } from '@automattic/i18n-utils'; import { StepContainer } from '@automattic/onboarding'; import { useTranslate } from 'i18n-calypso'; import { UpgradePlan } from 'calypso/blocks/importer/wordpress/upgrade-plan'; @@ -21,6 +22,7 @@ const SiteMigrationUpgradePlan: Step = function ( { navigation, data } ) { const siteItem = useSite(); const siteSlug = useSiteSlug(); const translate = useTranslate(); + const hasEnTranslation = useHasEnTranslation(); const queryParams = useQuery(); const hideFreeMigrationTrialForNonVerifiedEmail = ( data?.hideFreeMigrationTrialForNonVerifiedEmail as boolean | undefined ) ?? true; @@ -102,9 +104,22 @@ const SiteMigrationUpgradePlan: Step = function ( { navigation, data } ) { diff --git a/packages/calypso-products/src/plans-list.tsx b/packages/calypso-products/src/plans-list.tsx index 08b9cfc5c7e805..1c616d130d9d15 100644 --- a/packages/calypso-products/src/plans-list.tsx +++ b/packages/calypso-products/src/plans-list.tsx @@ -466,6 +466,9 @@ import { getPlanEcommerceTitle, getPlanPersonalTitle, getPlanPremiumTitle, + getPlanBusinessTrialTitle, + getPlanCommerceTrialTitle, + getPlanBusinessTrialTagline, } from './plans'; import type { BillingTerm, @@ -4089,8 +4092,8 @@ PLANS_LIST[ PLAN_ECOMMERCE_TRIAL_MONTHLY ] = { term: TERM_MONTHLY, getBillingTimeFrame: () => i18n.translate( 'free trial' ), getStoreSlug: () => PLAN_ECOMMERCE_TRIAL_MONTHLY, - getTitle: () => i18n.translate( 'Entrepreneur free trial' ), - getDescription: () => i18n.translate( 'Entrepreneur free trial' ), + getTitle: getPlanCommerceTrialTitle, + getDescription: getPlanCommerceTrialTitle, getTagline: () => i18n.translate( 'Get a taste of the world’s most popular eCommerce software.' ), }; @@ -4104,13 +4107,13 @@ if ( isEnabled( 'plans/migration-trial' ) ) { term: TERM_MONTHLY, getBillingTimeFrame: () => i18n.translate( 'free trial' ), getStoreSlug: () => PLAN_MIGRATION_TRIAL_MONTHLY, - getTitle: () => i18n.translate( 'Creator Trial' ), + getTitle: getPlanBusinessTrialTitle, }; } PLANS_LIST[ PLAN_HOSTING_TRIAL_MONTHLY ] = { ...getPlanBusinessDetails(), - getPlanTagline: () => i18n.translate( 'Try all the features of our Creator plan.' ), + getPlanTagline: getPlanBusinessTrialTagline, type: TYPE_BUSINESS, group: GROUP_WPCOM, getProductId: () => 1058, @@ -4118,7 +4121,7 @@ PLANS_LIST[ PLAN_HOSTING_TRIAL_MONTHLY ] = { term: TERM_MONTHLY, getBillingTimeFrame: () => i18n.translate( 'Try it for 3 days' ), getStoreSlug: () => PLAN_HOSTING_TRIAL_MONTHLY, - getTitle: () => i18n.translate( 'Creator Trial' ), + getTitle: getPlanBusinessTrialTitle, getDescription: () => i18n.translate( 'Hosting free trial' ), getTagline: () => i18n.translate( 'Get a taste of unlimited performance and unbeatable uptime' ), }; diff --git a/packages/calypso-products/src/plans.tsx b/packages/calypso-products/src/plans.tsx index 0225634b22de45..5a999fa11dd552 100644 --- a/packages/calypso-products/src/plans.tsx +++ b/packages/calypso-products/src/plans.tsx @@ -6,30 +6,53 @@ import { getPlansListExperiment } from './experiments'; * See: p7H4VZ-4S4-p2 */ +const isPlanNameChangeTreatment = + getPlansListExperiment( 'wpcom_plan_name_change_personal_premium_v1' ) === 'treatment'; export const getPlanPersonalTitle = () => - getPlansListExperiment( 'wpcom_plan_name_change_personal_premium_v1' ) === 'treatment' + isPlanNameChangeTreatment ? // translators: Personal is a plan name i18n.translate( 'Personal' ) : // translators: Starter is a plan name i18n.translate( 'Starter' ); export const getPlanPremiumTitle = () => - getPlansListExperiment( 'wpcom_plan_name_change_personal_premium_v1' ) === 'treatment' + isPlanNameChangeTreatment ? // translators: Premium is a plan name i18n.translate( 'Premium' ) : // translators: Explorer is a plan name i18n.translate( 'Explorer' ); export const getPlanBusinessTitle = () => - getPlansListExperiment( 'wpcom_plan_name_change_personal_premium_v1' ) === 'treatment' + isPlanNameChangeTreatment ? // translators: Business is a plan name i18n.translate( 'Business' ) : // translators: Creator is a plan name i18n.translate( 'Creator' ); export const getPlanEcommerceTitle = () => - getPlansListExperiment( 'wpcom_plan_name_change_personal_premium_v1' ) === 'treatment' + isPlanNameChangeTreatment ? // translators: Commerce is a plan name i18n.translate( 'Commerce' ) : // translators: Entrepreneur is a plan name i18n.translate( 'Entrepreneur' ); + +export const getPlanBusinessTrialTitle = () => + isPlanNameChangeTreatment + ? // translators: Business Trial is a plan name + i18n.translate( 'Business Trial' ) + : // translators: Creator Trial is a plan name + i18n.translate( 'Creator Trial' ); + +export const getPlanBusinessTrialTagline = () => + isPlanNameChangeTreatment + ? // translators: Business is a plan name + i18n.translate( 'Try all the features of our Business plan.' ) + : // translators: Creator is a plan name + i18n.translate( 'Try all the features of our Creator plan.' ); + +export const getPlanCommerceTrialTitle = () => + isPlanNameChangeTreatment + ? // translators: Commerce Trial is a plan name + i18n.translate( 'Commerce Trial' ) + : // translators: Entrepreneur Trial is a plan name + i18n.translate( 'Entrepreneur Trial' );