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

Checkout: Remove fallback translations for line item sublabels #81592

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading