Skip to content

Commit a65ab18

Browse files
committed
polish(payments): Fix ftl strings
1 parent da55ebd commit a65ab18

2 files changed

Lines changed: 127 additions & 112 deletions

File tree

  • libs/payments/ui/src/lib/client/components/SubscriptionContent

libs/payments/ui/src/lib/client/components/SubscriptionContent/en.ftl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
## $promotionName (String) - The name of the promotion.
1010
## $taxDue (Number) - The tax added on, not included in amount. It will be formatted as currency.
1111

12-
subscription-content-current-invoice-billed-on-with-tax = { $invoiceTotal } + { $taxDue } <span>billed on { $billedOnDate }</span>
13-
subscription-content-current-invoice-billed-on-no-tax = { $invoiceTotal } <span>billed on { $billedOnDate }</span>
12+
subscription-content-current-billed-on-tax = <strong>{ $invoiceTotal } + { $taxDue } tax</strong><span> billed on { $billedOnDate }</span>
13+
subscription-content-current-billed-on-no-tax = <strong>{ $invoiceTotal }</strong><span> billed on { $billedOnDate }</span>
1414
subscription-content-credit-issued-to-your-account = <strong>{ $creditApplied }</strong> credit issued to your account
1515
subscription-content-coupon-applied = { $promotionName } applied
16-
subscription-content-next-bill-excl-with-tax = Next bill of <strong>{ $nextInvoiceTotal } + { $taxDue }</strong>, excluding discounts, is due on <strong>{ $nextBillDate }</strong>
16+
subscription-content-next-bill-excl-disc-with-tax = Next bill of <strong>{ $nextInvoiceTotal } + { $taxDue } tax</strong>, excluding discounts, is due on <strong>{ $nextBillDate }</strong>
1717
subscription-content-next-bill-excl-no-tax = Next bill of <strong>{ $nextInvoiceTotal }</strong>, excluding discounts, is due on <strong>{ $nextBillDate }</strong>
1818
subscription-content-heading-cancel-subscription = Cancel Subscription
1919
subscription-content-no-longer-use-message = You will no longer be able to use { $productName } after { $currentPeriodEnd }, the last day of your billing cycle.

libs/payments/ui/src/lib/client/components/SubscriptionContent/index.tsx

Lines changed: 124 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,6 @@ export const SubscriptionContent = ({
104104
locale
105105
);
106106

107-
const spanElementBilledOnCurrentInvoiceDate = (
108-
<span className="font-normal text-grey-600 text-sm">
109-
billed on {currentInvoiceDateLongFallback}
110-
</span>
111-
);
112-
113107
async function cancelSubscriptionAtPeriodEnd() {
114108
const result = await cancelSubscriptionAtPeriodEndAction(
115109
userId,
@@ -530,109 +524,130 @@ export const SubscriptionContent = ({
530524
</>
531525
) : (
532526
<>
533-
<div className="leading-5">
534-
{currentInvoiceTax ? (
535-
<Localized
536-
id="subscription-content-current-invoice-billed-on-with-tax"
537-
vars={{
538-
billedOnDate: currentInvoiceDateLongFallback,
539-
invoiceTotal:
540-
getCurrencyFallbackText(currentInvoiceTotal),
541-
taxDue: getCurrencyFallbackText(currentInvoiceTax),
542-
}}
543-
elems={{ span: spanElementBilledOnCurrentInvoiceDate }}
544-
>
545-
<p className="text-base font-semibold">
546-
{getCurrencyFallbackText(currentInvoiceTotal)} +{' '}
547-
{getCurrencyFallbackText(currentInvoiceTax)} tax{' '}
548-
{spanElementBilledOnCurrentInvoiceDate}
549-
</p>
550-
</Localized>
551-
) : (
552-
<Localized
553-
id="subscription-content-current-invoice-billed-on-no-tax"
554-
vars={{
555-
billedOnDate: currentInvoiceDateLongFallback,
556-
invoiceTotal:
557-
getCurrencyFallbackText(currentInvoiceTotal),
558-
}}
559-
elems={{ span: spanElementBilledOnCurrentInvoiceDate }}
560-
>
561-
<p className="text-base font-semibold">
562-
{getCurrencyFallbackText(currentInvoiceTotal)}{' '}
563-
{spanElementBilledOnCurrentInvoiceDate}
564-
</p>
565-
</Localized>
566-
)}
567-
{creditApplied && creditApplied > 0 ? (
568-
<Localized
569-
id="subscription-content-credit-issued-to-your-account"
570-
vars={{
571-
creditApplied: getCurrencyFallbackText(creditApplied),
572-
}}
573-
>
574-
<p className="text-green-900 text-sm">
575-
<strong>{getCurrencyFallbackText(creditApplied)}</strong>{' '}
576-
credit issued to your account
577-
</p>
578-
</Localized>
579-
) : null}
580-
{promotionName && (
581-
<Localized
582-
id="subscription-content-coupon-applied"
583-
vars={{
584-
promotionName,
585-
}}
586-
>
587-
<p className="font-bold text-sm text-violet-700">
588-
{promotionName} applied
589-
</p>
590-
</Localized>
591-
)}
592-
{nextInvoiceTotal !== undefined && nextInvoiceTotal >= 0 ? (
593-
<div className="text-sm">
594-
{nextInvoiceTax ? (
595-
<Localized
596-
id="subscription-content-next-bill-excl-discount-with-tax"
597-
vars={{
598-
nextBillDate: currentPeriodEndLongFallback,
599-
nextInvoiceTotal:
600-
getCurrencyFallbackText(nextInvoiceTotal),
601-
taxDue: getCurrencyFallbackText(nextInvoiceTax),
602-
}}
603-
>
604-
<p>
605-
Next bill of{' '}
606-
<strong>
607-
{getCurrencyFallbackText(nextInvoiceTotal)} +{' '}
608-
{getCurrencyFallbackText(nextInvoiceTax)} tax
609-
</strong>
610-
, excluding discounts, is due{' '}
611-
<strong>{currentPeriodEndLongFallback}</strong>
612-
</p>
613-
</Localized>
614-
) : (
615-
<Localized
616-
id="subscription-content-next-bill-excl-discount-no-tax"
617-
vars={{
618-
nextBillDate: currentPeriodEndLongFallback,
619-
nextInvoiceTotal:
620-
getCurrencyFallbackText(nextInvoiceTotal),
621-
}}
622-
>
623-
<p>
624-
Next bill of{' '}
625-
<strong>
626-
{getCurrencyFallbackText(nextInvoiceTotal)}
627-
</strong>
628-
, excluding discounts, is due{' '}
629-
<strong>{currentPeriodEndLongFallback}</strong>
630-
</p>
631-
</Localized>
632-
)}
633-
</div>
634-
) : null}
635-
</div>
527+
{isClient && (
528+
<div className="leading-5">
529+
{currentInvoiceTax ? (
530+
<Localized
531+
id="subscription-content-current-billed-on-tax"
532+
vars={{
533+
billedOnDate: currentInvoiceDateLongFallback,
534+
invoiceTotal:
535+
getCurrencyFallbackText(currentInvoiceTotal),
536+
taxDue: getCurrencyFallbackText(currentInvoiceTax),
537+
}}
538+
elems={{
539+
strong: <strong></strong>,
540+
span: <span className="text-grey-600 text-sm"></span>,
541+
}}
542+
>
543+
<p>
544+
<strong>
545+
{getCurrencyFallbackText(currentInvoiceTotal)} +{' '}
546+
{getCurrencyFallbackText(currentInvoiceTax)} tax{' '}
547+
</strong>
548+
<span className="text-grey-600 text-sm">
549+
billed on {currentInvoiceDateLongFallback}
550+
</span>
551+
</p>
552+
</Localized>
553+
) : (
554+
<Localized
555+
id="subscription-content-current-billed-on-no-tax"
556+
vars={{
557+
billedOnDate: currentInvoiceDateLongFallback,
558+
invoiceTotal:
559+
getCurrencyFallbackText(currentInvoiceTotal),
560+
}}
561+
elems={{
562+
strong: <strong></strong>,
563+
span: <span className="text-grey-600 text-sm"></span>,
564+
}}
565+
>
566+
<p>
567+
<strong>
568+
{getCurrencyFallbackText(currentInvoiceTotal)}
569+
</strong>
570+
<span className="text-grey-600 text-sm">
571+
billed on {currentInvoiceDateLongFallback}
572+
</span>
573+
</p>
574+
</Localized>
575+
)}
576+
{creditApplied && creditApplied > 0 ? (
577+
<Localized
578+
id="subscription-content-credit-issued-to-your-account"
579+
vars={{
580+
creditApplied: getCurrencyFallbackText(creditApplied),
581+
}}
582+
elems={{ strong: <strong></strong> }}
583+
>
584+
<p className="text-green-900 text-sm">
585+
<strong>
586+
{getCurrencyFallbackText(creditApplied)}
587+
</strong>{' '}
588+
credit issued to your account
589+
</p>
590+
</Localized>
591+
) : null}
592+
{promotionName && (
593+
<Localized
594+
id="subscription-content-coupon-applied"
595+
vars={{
596+
promotionName,
597+
}}
598+
>
599+
<p className="font-bold text-sm text-violet-700">
600+
{promotionName} applied
601+
</p>
602+
</Localized>
603+
)}
604+
{nextInvoiceTotal !== undefined && nextInvoiceTotal >= 0 ? (
605+
<div className="text-sm">
606+
{nextInvoiceTax ? (
607+
<Localized
608+
id="subscription-content-next-bill-excl-disc-with-tax"
609+
vars={{
610+
nextBillDate: currentPeriodEndLongFallback,
611+
nextInvoiceTotal:
612+
getCurrencyFallbackText(nextInvoiceTotal),
613+
taxDue: getCurrencyFallbackText(nextInvoiceTax),
614+
}}
615+
elems={{ strong: <strong></strong> }}
616+
>
617+
<p>
618+
Next bill of{' '}
619+
<strong>
620+
{getCurrencyFallbackText(nextInvoiceTotal)} +{' '}
621+
{getCurrencyFallbackText(nextInvoiceTax)} tax
622+
</strong>
623+
, excluding discounts, is due{' '}
624+
<strong>{currentPeriodEndLongFallback}</strong>
625+
</p>
626+
</Localized>
627+
) : (
628+
<Localized
629+
id="subscription-content-next-bill-excl-no-tax"
630+
vars={{
631+
nextBillDate: currentPeriodEndLongFallback,
632+
nextInvoiceTotal:
633+
getCurrencyFallbackText(nextInvoiceTotal),
634+
}}
635+
elems={{ strong: <strong></strong> }}
636+
>
637+
<p>
638+
Next bill of{' '}
639+
<strong>
640+
{getCurrencyFallbackText(nextInvoiceTotal)}
641+
</strong>
642+
, excluding discounts, is due{' '}
643+
<strong>{currentPeriodEndLongFallback}</strong>
644+
</p>
645+
</Localized>
646+
)}
647+
</div>
648+
) : null}
649+
</div>
650+
)}
636651
<Localized
637652
id="subscription-content-button-cancel"
638653
vars={{ productName }}

0 commit comments

Comments
 (0)