diff --git a/apps/comments-ui/src/components/content/CTABox.tsx b/apps/comments-ui/src/components/content/CTABox.tsx index 6290d728cb24..fedcbd80019d 100644 --- a/apps/comments-ui/src/components/content/CTABox.tsx +++ b/apps/comments-ui/src/components/content/CTABox.tsx @@ -26,7 +26,7 @@ const CTABox: React.FC = ({isFirst, isPaid}) => { window.location.href = '#/portal/signin'; }; - const text = reactStringReplace(isPaid ? t('Become a paid member of {{publication}} to start commenting.') : t('Become a member of {{publication}} to start commenting.'), '{{publication}}', () => ( + const text = reactStringReplace(isPaid ? t('Become a paid member of {publication} to start commenting.') : t('Become a member of {publication} to start commenting.'), '{publication}', () => ( {publication} )); diff --git a/apps/comments-ui/src/components/content/ContentTitle.tsx b/apps/comments-ui/src/components/content/ContentTitle.tsx index 4f109847bb31..3a7615f928f0 100644 --- a/apps/comments-ui/src/components/content/ContentTitle.tsx +++ b/apps/comments-ui/src/components/content/ContentTitle.tsx @@ -19,7 +19,7 @@ const Count: React.FC = ({showCount, count}) => { } return ( -
{t('{{amount}} comments', {amount: formatNumber(count)})}
+
{t('{amount} comments', {amount: formatNumber(count)})}
); }; diff --git a/apps/comments-ui/src/components/content/Pagination.tsx b/apps/comments-ui/src/components/content/Pagination.tsx index a6b116fcb397..2e1e1efa5c2f 100644 --- a/apps/comments-ui/src/components/content/Pagination.tsx +++ b/apps/comments-ui/src/components/content/Pagination.tsx @@ -22,7 +22,7 @@ const Pagination = () => { // TODO: add i18n support for these strings when removing labs flag const text = labs.commentImprovements ? (left === 1 ? 'Load more (1)' : `Load more (${formatNumber(left)})`) - : (left === 1 ? t('Show 1 previous comment') : t('Show {{amount}} previous comments', {amount: formatNumber(left)})); + : (left === 1 ? t('Show 1 previous comment') : t('Show {amount} previous comments', {amount: formatNumber(left)})); return ( labs.commentImprovements ? ( diff --git a/apps/comments-ui/src/components/content/RepliesPagination.tsx b/apps/comments-ui/src/components/content/RepliesPagination.tsx index 1c8ec8edb847..9a1ce1570eac 100644 --- a/apps/comments-ui/src/components/content/RepliesPagination.tsx +++ b/apps/comments-ui/src/components/content/RepliesPagination.tsx @@ -8,8 +8,8 @@ type Props = { }; const RepliesPagination: React.FC = ({loadMore, count}) => { const {t} = useAppContext(); - const longText = count === 1 ? t('Show 1 more reply') : t('Show {{amount}} more replies', {amount: formatNumber(count)}); - const shortText = t('{{amount}} more', {amount: formatNumber(count)}); + const longText = count === 1 ? t('Show 1 more reply') : t('Show {amount} more replies', {amount: formatNumber(count)}); + const shortText = t('{amount} more', {amount: formatNumber(count)}); return (
diff --git a/apps/comments-ui/src/components/popups/AddDetailsPopup.tsx b/apps/comments-ui/src/components/popups/AddDetailsPopup.tsx index 754f0e68bdda..d8b3ff5fb661 100644 --- a/apps/comments-ui/src/components/popups/AddDetailsPopup.tsx +++ b/apps/comments-ui/src/components/popups/AddDetailsPopup.tsx @@ -111,7 +111,7 @@ const AddDetailsPopup = (props: Props) => { return returnable; }; - const charsText = reactStringReplace(t('{{amount}} characters left'), '{{amount}}', () => { + const charsText = reactStringReplace(t('{amount} characters left'), '{amount}', () => { return {expertiseCharsLeft}; }); diff --git a/apps/comments-ui/src/utils/helpers.ts b/apps/comments-ui/src/utils/helpers.ts index 7fb406139e88..6d42524734ab 100644 --- a/apps/comments-ui/src/utils/helpers.ts +++ b/apps/comments-ui/src/utils/helpers.ts @@ -20,7 +20,7 @@ export function formatRelativeTime(dateString: string, t: TranslationFunction): } if (diff < 60) { - return t('{{amount}} seconds ago', {amount: diff}); + return t('{amount} seconds ago', {amount: diff}); } // Diff in minutes @@ -29,7 +29,7 @@ export function formatRelativeTime(dateString: string, t: TranslationFunction): if (Math.floor(diff) === 1) { return t(`One min ago`); } - return t('{{amount}} mins ago', {amount: Math.floor(diff)}); + return t('{amount} mins ago', {amount: Math.floor(diff)}); } // First check for yesterday @@ -45,7 +45,7 @@ export function formatRelativeTime(dateString: string, t: TranslationFunction): if (Math.floor(diff) === 1) { return t(`One hour ago`); } - return t('{{amount}} hrs ago', {amount: Math.floor(diff)}); + return t('{amount} hrs ago', {amount: Math.floor(diff)}); } // Diff in days @@ -55,7 +55,7 @@ export function formatRelativeTime(dateString: string, t: TranslationFunction): // Special case, we should compare based on dates in the future instead return t(`One day ago`); } - return t('{{amount}} days ago', {amount: Math.floor(diff)}); + return t('{amount} days ago', {amount: Math.floor(diff)}); } // Diff in weeks @@ -65,7 +65,7 @@ export function formatRelativeTime(dateString: string, t: TranslationFunction): // Special case, we should compare based on dates in the future instead return t(`One week ago`); } - return t('{{amount}} weeks ago', {amount: Math.floor(diff)}); + return t('{amount} weeks ago', {amount: Math.floor(diff)}); } // Diff in months @@ -75,7 +75,7 @@ export function formatRelativeTime(dateString: string, t: TranslationFunction): // Special case, we should compare based on dates in the future instead return t(`One month ago`); } - return t('{{amount}} months ago', {amount: Math.floor(diff)}); + return t('{amount} months ago', {amount: Math.floor(diff)}); } // Diff in years @@ -84,7 +84,7 @@ export function formatRelativeTime(dateString: string, t: TranslationFunction): // Special case, we should compare based on dates in the future instead return t(`One year ago`); } - return t('{{amount}} years ago', {amount: Math.floor(diff)}); + return t('{amount} years ago', {amount: Math.floor(diff)}); } export function formatExplicitTime(dateString: string): string { diff --git a/apps/portal/src/components/Notification.js b/apps/portal/src/components/Notification.js index edc1743877ca..6ac719fda34d 100644 --- a/apps/portal/src/components/Notification.js +++ b/apps/portal/src/components/Notification.js @@ -34,7 +34,7 @@ const NotificationText = ({type, status, context}) => { const firstname = context.member.firstname || ''; return (

- {firstname ? t('Welcome back, {{name}}!', {name: firstname}) : t('Welcome back!')}
{t('You\'ve successfully signed in.')} + {firstname ? t('Welcome back, {name}!', {name: firstname}) : t('Welcome back!')}
{t('You\'ve successfully signed in.')}

); } else if (type === 'signin' && status === 'error') { diff --git a/apps/portal/src/components/common/NewsletterManagement.js b/apps/portal/src/components/common/NewsletterManagement.js index 9fcf1de2ee11..67d9dc4683aa 100644 --- a/apps/portal/src/components/common/NewsletterManagement.js +++ b/apps/portal/src/components/common/NewsletterManagement.js @@ -136,7 +136,7 @@ function ShowPaidMemberMessage({site, isPaid}) { if (isPaid) { return ( -

{t('Unsubscribing from emails will not cancel your paid subscription to {{title}}', {title: site?.title})}

+

{t('Unsubscribing from emails will not cancel your paid subscription to {title}', {title: site?.title})}

); } return null; diff --git a/apps/portal/src/components/common/ProductsSection.js b/apps/portal/src/components/common/ProductsSection.js index 9bc2db6fba93..a6c2872c30e6 100644 --- a/apps/portal/src/components/common/ProductsSection.js +++ b/apps/portal/src/components/common/ProductsSection.js @@ -586,7 +586,7 @@ function ProductCardTrialDays({trialDays, discount, selectedInterval}) { if (hasFreeTrialTier({site})) { if (trialDays) { return ( - {t('{{trialDays}} days free', {trialDays})} + {t('{trialDays} days free', {trialDays})} ); } else { return null; @@ -595,7 +595,7 @@ function ProductCardTrialDays({trialDays, discount, selectedInterval}) { if (selectedInterval === 'year') { return ( - {t('{{discount}}% discount', {discount})} + {t('{discount}% discount', {discount})} ); } @@ -748,7 +748,7 @@ function ProductCardButton({selectedProduct, product, disabled, noOfProducts, tr return ( - {t('{{discount}}% discount', {discount})} + {t('{discount}% discount', {discount})} ); } else { return ( <> - {t('{{discount}}% discount', {discount})} + {t('{discount}% discount', {discount})} ); } @@ -900,7 +900,7 @@ function ProductPriceSwitch({selectedInterval, setSelectedInterval, products}) { }} > {t('Yearly')} - {(highestYearlyDiscount > 0) && {t('(save {{highestYearlyDiscount}}%)', {highestYearlyDiscount})}} + {(highestYearlyDiscount > 0) && {t('(save {highestYearlyDiscount}%)', {highestYearlyDiscount})}}
@@ -973,7 +973,7 @@ function ProductsSection({onPlanSelect, products, type = null, handleChooseSignu const supportAddress = getSupportAddress({site}); return (

- {t('Please contact {{supportAddress}} to adjust your complimentary subscription.', {supportAddress})} + {t('Please contact {supportAddress} to adjust your complimentary subscription.', {supportAddress})}

); } else { diff --git a/apps/portal/src/components/pages/AccountEmailPage.js b/apps/portal/src/components/pages/AccountEmailPage.js index f8466b0caa7d..2a4f5317b3ca 100644 --- a/apps/portal/src/components/pages/AccountEmailPage.js +++ b/apps/portal/src/components/pages/AccountEmailPage.js @@ -45,7 +45,7 @@ export default function AccountEmailPage() {

{member?.email} }} @@ -68,7 +68,7 @@ export default function AccountEmailPage() {

{member?.email}, newsletterName: {unsubscribedNewsletter?.name} diff --git a/apps/portal/src/components/pages/AccountHomePage/components/AccountWelcome.js b/apps/portal/src/components/pages/AccountHomePage/components/AccountWelcome.js index ea05241b5a68..2902757f364d 100644 --- a/apps/portal/src/components/pages/AccountHomePage/components/AccountWelcome.js +++ b/apps/portal/src/components/pages/AccountHomePage/components/AccountWelcome.js @@ -24,7 +24,7 @@ const AccountWelcome = () => { const expiryAt = getDateString(expiryDate); return (

-

{t(`Your subscription will expire on {{expiryDate}}`, {expiryDate: expiryAt})}

+

{t(`Your subscription will expire on {expiryDate}`, {expiryDate: expiryAt})}

); } @@ -40,13 +40,13 @@ const AccountWelcome = () => { const trialEnd = getDateString(subscription.trial_end_at); return (
-

{t(`Your subscription will start on {{subscriptionStart}}`, {subscriptionStart: trialEnd})}

+

{t(`Your subscription will start on {subscriptionStart}`, {subscriptionStart: trialEnd})}

); } return (
-

{t(`Your subscription will renew on {{renewalDate}}`, {renewalDate: getDateString(currentPeriodEnd)})}

+

{t(`Your subscription will renew on {renewalDate}`, {renewalDate: getDateString(currentPeriodEnd)})}

); } diff --git a/apps/portal/src/components/pages/AccountHomePage/components/ContinueSubscriptionButton.js b/apps/portal/src/components/pages/AccountHomePage/components/ContinueSubscriptionButton.js index c7fbefe1839a..e3569e7b51cb 100644 --- a/apps/portal/src/components/pages/AccountHomePage/components/ContinueSubscriptionButton.js +++ b/apps/portal/src/components/pages/AccountHomePage/components/ContinueSubscriptionButton.js @@ -26,7 +26,7 @@ const ContinueSubscriptionButton = () => { } const currentPeriodEnd = subscription.current_period_end; return ( -

{t(`Your subscription will expire on {{expiryDate}}`, {expiryDate: getDateString(currentPeriodEnd)})}

+

{t(`Your subscription will expire on {expiryDate}`, {expiryDate: getDateString(currentPeriodEnd)})}

); }; diff --git a/apps/portal/src/components/pages/AccountHomePage/components/PaidAccountActions.js b/apps/portal/src/components/pages/AccountHomePage/components/PaidAccountActions.js index 7bd14f805639..41ecace31b2b 100644 --- a/apps/portal/src/components/pages/AccountHomePage/components/PaidAccountActions.js +++ b/apps/portal/src/components/pages/AccountHomePage/components/PaidAccountActions.js @@ -37,7 +37,7 @@ const PaidAccountActions = () => { const compExpiry = getCompExpiry({member}); if (isComplimentary) { if (compExpiry) { - label = `${t('Complimentary')} - ${t('Expires {{expiryDate}}', {expiryDate: compExpiry})}`; + label = `${t('Complimentary')} - ${t('Expires {expiryDate}', {expiryDate: compExpiry})}`; } else { label = label ? `${t('Complimentary')} (${label})` : t(`Complimentary`); } @@ -177,7 +177,7 @@ function FreeTrialLabel({subscription, t}) { return (

- {t('Free Trial – Ends {{trialEnd}}', {trialEnd})} + {t('Free Trial – Ends {trialEnd}', {trialEnd})} {/* {getSubFreeTrialDaysLeft({sub: subscription})} days left */}

@@ -210,7 +210,7 @@ function getOfferLabel({offer, price, subscriptionStartDate, t}) { if (isInThePast(offerEndDate)) { return ''; } - durationLabel = t('Ends {{offerEndDate}}', {offerEndDate: getDateString(offerEndDate)}); + durationLabel = t('Ends {offerEndDate}', {offerEndDate: getDateString(offerEndDate)}); } offerLabel = `${getUpdatedOfferPrice({offer, price, useFormatted: true})}/${price.interval}${durationLabel ? ` — ${durationLabel}` : ``}`; } diff --git a/apps/portal/src/components/pages/AccountPlanPage.js b/apps/portal/src/components/pages/AccountPlanPage.js index f7d8f92917fd..65f41a9c08bc 100644 --- a/apps/portal/src/components/pages/AccountPlanPage.js +++ b/apps/portal/src/components/pages/AccountPlanPage.js @@ -117,7 +117,7 @@ const PlanConfirmationSection = ({plan, type, onConfirm}) => { const label = t('Confirm'); const planStartDate = getDateString(subscription.current_period_end); const currentActivePlan = getMemberActivePrice({member}); - let planStartingMessage = t('Starting {{startDate}}', {startDate: planStartDate}); + let planStartingMessage = t('Starting {startDate}', {startDate: planStartDate}); if (currentActivePlan.id !== plan.id) { planStartingMessage = t('Starting today'); } @@ -162,7 +162,7 @@ const PlanConfirmationSection = ({plan, type, onConfirm}) => {

{getDateString(subscription.current_period_end)} }} diff --git a/apps/portal/src/components/pages/EmailReceivingFAQ.js b/apps/portal/src/components/pages/EmailReceivingFAQ.js index f2a233cb93d9..c5c669ec94bd 100644 --- a/apps/portal/src/components/pages/EmailReceivingFAQ.js +++ b/apps/portal/src/components/pages/EmailReceivingFAQ.js @@ -39,7 +39,7 @@ export default function EmailReceivingPage() {

account settings area.`)} + string={t(`The email address we have for you is {memberEmail} — if that's not correct, you can update it in your .`)} mapping={{ memberEmail: {member.email}, button: