fix(i18n): mark billing messages for translation (#2525)

This commit is contained in:
Konrad 2026-03-17 02:05:27 +01:00 committed by GitHub
parent de134afba1
commit 647dc5fc2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 (
<div className="flex items-center justify-center rounded-lg py-32">
<Loader className="text-muted-foreground h-6 w-6 animate-spin" />
<Loader className="h-6 w-6 animate-spin text-muted-foreground" />
</div>
);
}
@ -57,7 +57,7 @@ export default function TeamsSettingBillingPage() {
<Trans>Billing</Trans>
</h3>
<div className="text-muted-foreground mt-2 text-sm">
<div className="mt-2 text-sm text-muted-foreground">
{!organisationSubscription && (
<p>
<Trans>
@ -70,36 +70,51 @@ export default function TeamsSettingBillingPage() {
match(organisationSubscription.status)
.with('ACTIVE', () => (
<p>
{currentProductName ? (
<span>
You are currently subscribed to{' '}
<span className="font-semibold">{currentProductName}</span>
</span>
) : (
<span>You currently have an active plan</span>
)}
{organisationSubscription.periodEnd && (
<span>
{' '}
which is set to{' '}
{organisationSubscription.cancelAtPeriodEnd ? (
<span>
end on{' '}
<span className="font-semibold">
{i18n.date(organisationSubscription.periodEnd)}.
</span>
</span>
{match(organisationSubscription)
.with(
{ cancelAtPeriodEnd: true, periodEnd: P.nonNullable },
({ periodEnd }) =>
currentProductName ? (
<Trans>
You are currently subscribed to{' '}
<span className="font-semibold">{currentProductName}</span> which is
set to end on{' '}
<span className="font-semibold">{i18n.date(periodEnd)}</span>.
</Trans>
) : (
<Trans>
You currently have an active plan which is set to end on{' '}
<span className="font-semibold">{i18n.date(periodEnd)}</span>.
</Trans>
),
)
.with(
{ cancelAtPeriodEnd: false, periodEnd: P.nonNullable },
({ periodEnd }) =>
currentProductName ? (
<Trans>
You are currently subscribed to{' '}
<span className="font-semibold">{currentProductName}</span> which is
set to automatically renew on{' '}
<span className="font-semibold">{i18n.date(periodEnd)}</span>.
</Trans>
) : (
<Trans>
You currently have an active plan which is set to automatically renew
on <span className="font-semibold">{i18n.date(periodEnd)}</span>.
</Trans>
),
)
.otherwise(() =>
currentProductName ? (
<Trans>
You are currently subscribed to{' '}
<span className="font-semibold">{currentProductName}</span>.
</Trans>
) : (
<span>
automatically renew on{' '}
<span className="font-semibold">
{i18n.date(organisationSubscription.periodEnd)}.
</span>
</span>
)}
</span>
)}
<Trans>You currently have an active plan.</Trans>
),
)}
</p>
))
.with('INACTIVE', () => (
@ -107,7 +122,7 @@ export default function TeamsSettingBillingPage() {
{currentProductName ? (
<Trans>
You currently have an inactive{' '}
<span className="font-semibold">{currentProductName}</span> subscription
<span className="font-semibold">{currentProductName}</span> subscription.
</Trans>
) : (
<Trans>Your current plan is inactive.</Trans>