Skip to content

Commit

Permalink
Checkout: Remove fallback translations for line item sublabels (#81592)
Browse files Browse the repository at this point in the history
  • Loading branch information
sirbrillig authored Sep 11, 2023
1 parent 984e35a commit 4d8d10c
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions packages/wpcom-checkout/src/checkout-line-items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
} from '@automattic/composite-checkout';
import formatCurrency from '@automattic/format-currency';
import styled from '@emotion/styled';
import i18n, { getLocaleSlug, useTranslate } from 'i18n-calypso';
import { useTranslate } from 'i18n-calypso';
import { useState, PropsWithChildren } from 'react';
import { getLabel, DefaultLineItemSublabel } from './checkout-labels';
import { getItemIntroductoryOfferDisplay } from './introductory-offer';
Expand Down Expand Up @@ -731,12 +731,7 @@ export function LineItemSublabelAndPrice( { product }: { product: ResponseCartPr
return (
<>
<DefaultLineItemSublabel product={ product } />:{ ' ' }
{ getLocaleSlug()?.startsWith( 'en' ) || i18n.hasTranslation( '%(price)s per month' )
? translate( '%(price)s per month', { args: { price } } )
: translate( '%(sublabel)s: %(price)s per month', {
textOnly: true,
args: { sublabel: '_', price },
} ).replace( '_:', '' ) }
{ translate( '%(price)s per month', { args: { price } } ) }
</>
);
}
Expand All @@ -745,12 +740,7 @@ export function LineItemSublabelAndPrice( { product }: { product: ResponseCartPr
return (
<>
<DefaultLineItemSublabel product={ product } />:{ ' ' }
{ getLocaleSlug()?.startsWith( 'en' ) || i18n.hasTranslation( '%(price)s per year' )
? translate( '%(price)s per year', { args: { price } } )
: translate( '%(sublabel)s: %(price)s per year', {
textOnly: true,
args: { sublabel: '_', price },
} ).replace( '_:', '' ) }
{ translate( '%(price)s per year', { args: { price } } ) }
</>
);
}
Expand All @@ -759,12 +749,7 @@ export function LineItemSublabelAndPrice( { product }: { product: ResponseCartPr
return (
<>
<DefaultLineItemSublabel product={ product } />:{ ' ' }
{ getLocaleSlug()?.startsWith( 'en' ) || i18n.hasTranslation( '%(price)s per two years' )
? translate( '%(price)s per two years', { args: { price } } )
: translate( '%(sublabel)s: %(price)s per two years', {
textOnly: true,
args: { sublabel: '_', price },
} ).replace( '_:', '' ) }
{ translate( '%(price)s per two years', { args: { price } } ) }
</>
);
}
Expand All @@ -773,12 +758,7 @@ export function LineItemSublabelAndPrice( { product }: { product: ResponseCartPr
return (
<>
<DefaultLineItemSublabel product={ product } />:{ ' ' }
{ getLocaleSlug()?.startsWith( 'en' ) || i18n.hasTranslation( '%(price)s per three years' )
? translate( '%(price)s per three years', { args: { price } } )
: translate( '%(sublabel)s: %(price)s per three years', {
textOnly: true,
args: { sublabel: '_', price },
} ).replace( '_:', '' ) }
{ translate( '%(price)s per three years', { args: { price } } ) }
</>
);
}
Expand Down

0 comments on commit 4d8d10c

Please sign in to comment.