From 647dc5fc2d359955ff7afdf2a14d6b51cb60c7f7 Mon Sep 17 00:00:00 2001 From: Konrad <11725227+mKoonrad@users.noreply.github.com> Date: Tue, 17 Mar 2026 02:05:27 +0100 Subject: [PATCH] fix(i18n): mark billing messages for translation (#2525) --- .../o.$orgUrl.settings.billing.tsx | 81 +++++++++++-------- 1 file changed, 48 insertions(+), 33 deletions(-) diff --git a/apps/remix/app/routes/_authenticated+/o.$orgUrl.settings.billing.tsx b/apps/remix/app/routes/_authenticated+/o.$orgUrl.settings.billing.tsx index d309cf166..b548ef777 100644 --- a/apps/remix/app/routes/_authenticated+/o.$orgUrl.settings.billing.tsx +++ b/apps/remix/app/routes/_authenticated+/o.$orgUrl.settings.billing.tsx @@ -3,7 +3,7 @@ import { Trans } from '@lingui/react/macro'; import { SubscriptionStatus } from '@prisma/client'; import { Loader } from 'lucide-react'; import type Stripe from 'stripe'; -import { match } from 'ts-pattern'; +import { P, match } from 'ts-pattern'; import { useCurrentOrganisation } from '@documenso/lib/client-only/providers/organisation'; import { canExecuteOrganisationAction } from '@documenso/lib/utils/organisations'; @@ -31,7 +31,7 @@ export default function TeamsSettingBillingPage() { if (isLoadingSubscription || !subscriptionQuery) { return (
- +
); } @@ -57,7 +57,7 @@ export default function TeamsSettingBillingPage() { Billing -
+
{!organisationSubscription && (

@@ -70,36 +70,51 @@ export default function TeamsSettingBillingPage() { match(organisationSubscription.status) .with('ACTIVE', () => (

- {currentProductName ? ( - - You are currently subscribed to{' '} - {currentProductName} - - ) : ( - You currently have an active plan - )} - - {organisationSubscription.periodEnd && ( - - {' '} - which is set to{' '} - {organisationSubscription.cancelAtPeriodEnd ? ( - - end on{' '} - - {i18n.date(organisationSubscription.periodEnd)}. - - + {match(organisationSubscription) + .with( + { cancelAtPeriodEnd: true, periodEnd: P.nonNullable }, + ({ periodEnd }) => + currentProductName ? ( + + You are currently subscribed to{' '} + {currentProductName} which is + set to end on{' '} + {i18n.date(periodEnd)}. + + ) : ( + + You currently have an active plan which is set to end on{' '} + {i18n.date(periodEnd)}. + + ), + ) + .with( + { cancelAtPeriodEnd: false, periodEnd: P.nonNullable }, + ({ periodEnd }) => + currentProductName ? ( + + You are currently subscribed to{' '} + {currentProductName} which is + set to automatically renew on{' '} + {i18n.date(periodEnd)}. + + ) : ( + + You currently have an active plan which is set to automatically renew + on {i18n.date(periodEnd)}. + + ), + ) + .otherwise(() => + currentProductName ? ( + + You are currently subscribed to{' '} + {currentProductName}. + ) : ( - - automatically renew on{' '} - - {i18n.date(organisationSubscription.periodEnd)}. - - - )} - - )} + You currently have an active plan. + ), + )}

)) .with('INACTIVE', () => ( @@ -107,7 +122,7 @@ export default function TeamsSettingBillingPage() { {currentProductName ? ( You currently have an inactive{' '} - {currentProductName} subscription + {currentProductName} subscription. ) : ( Your current plan is inactive.