feat: initial i18n marketing implementation (#1223)

## Description

This PR introduces an initial i18n implementation using
[Lingui](https://lingui.dev).

We plan to combine it with Crowdin which will provide AI translations
when PRs are merged into main.

We plan to rollout i18n to only marketing for now, and will review how
everything goes before continuing to introduce it into the main
application.

## Reasoning

Why not use i18n-next or other alternatives?

To hopefully provide the best DX we chose Lingui because it allows us to
simply wrap text that we want to translate in tags, instead of forcing
users to do things such as:

- Update the text to `t('some-text')`
- Extract it to the file
- The text becomes a bit unreadable unless done correctly

Yes, plugins such as i18n-ally and Sherlock exist to simplify these
chores, but these require the user to be correctly setup in vscode, and
it also does not seem to provide the required configurations for our
multi app and multi UI package setup.

## Super simple demo

```html
// Before
<p>Text to update</p>

// After
<p>
  <Trans>Text to update</Trans>
</p>
```

## Related Issue

Relates to #885 but is only for marketing for now.

Another branch is slowly being prepared for the changes required for the
web application while we wait to see how this goes for marketing.

## Changes Made

Our configuration does not follow the general standard since we have
translations that cross:
- Web app
- Marketing app
- Constants package
- UI package

This means we want to separate translations into:
1. Marketing - Only translations extracted from `apps/marketing`
2. Web - Only translations extracted from `apps/web`
3. Common - Translations from `packages/constants` and `packages/ui`

Then we bundle, compile and minify the translations for production as
follows:
1. Marketing = Marketing + Common
2. Web = Web + Common

This allows us to only load the required translations when running each
application.

Overall general changes: 
- Add i18n to marketing
- Add core i18n setup to web
- Add pre-commit hook and GH action to extract any new <Trans> tags into
the translation files

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit


- **New Features**
- Added Romanian localization for marketing messages to improve
accessibility for Romanian-speaking users.
- Introduced German and English translation modules and PO files to
enhance the application's internationalization capabilities.
- Integrated internationalization support in the RootLayout component
for dynamic language settings based on server-side configurations.
- Enhanced the Enterprise component with translation support to adapt to
user language preferences.
- Added a `<meta>` tag to prevent Google from translating the page
content, supporting internationalization efforts.

- **Bug Fixes**
- Resolved minor issues related to the structure and accessibility of
translation files.

- **Chores**
- Updated project dependencies to support the new localization features
and ensure stability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Lucas Smith <me@lucasjamessmith.me>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@documenso.com>
This commit is contained in:
David Nguyen
2024-07-26 14:56:42 +10:00
committed by GitHub
parent 277a870580
commit 1028184cf2
71 changed files with 5491 additions and 478 deletions

View File

@ -1,12 +1,17 @@
import type { Metadata } from 'next';
import { Trans } from '@lingui/macro';
import { allBlogPosts } from 'contentlayer/generated';
import { setupI18nSSR } from '@documenso/lib/client-only/providers/i18n.server';
export const metadata: Metadata = {
title: 'Blog',
};
export default function BlogPage() {
const { i18n } = setupI18nSSR();
const blogPosts = allBlogPosts.sort((a, b) => {
const dateA = new Date(a.date);
const dateB = new Date(b.date);
@ -17,11 +22,15 @@ export default function BlogPage() {
return (
<div className="mt-6 sm:mt-12">
<div className="text-center">
<h1 className="text-3xl font-bold lg:text-5xl">From the blog</h1>
<h1 className="text-3xl font-bold lg:text-5xl">
<Trans>From the blog</Trans>
</h1>
<p className="text-muted-foreground mx-auto mt-4 max-w-xl text-center text-lg leading-normal">
Get the latest news from Documenso, including product updates, team announcements and
more!
<Trans>
Get the latest news from Documenso, including product updates, team announcements and
more!
</Trans>
</p>
</div>
@ -33,7 +42,7 @@ export default function BlogPage() {
>
<div className="flex items-center gap-x-4 text-xs">
<time dateTime={post.date} className="text-muted-foreground">
{new Date(post.date).toLocaleDateString()}
<Trans>{i18n.date(new Date(), { dateStyle: 'short' })}</Trans>
</time>
{post.tags.length > 0 && (

View File

@ -1,10 +1,12 @@
import { msg } from '@lingui/macro';
export const TEAM_MEMBERS = [
{
name: 'Timur Ercan',
role: 'Co-Founder, CEO',
salary: 95_000,
location: 'Germany',
engagement: 'Full-Time',
engagement: msg`Full-Time`,
joinDate: 'November 14th, 2022',
},
{
@ -12,7 +14,7 @@ export const TEAM_MEMBERS = [
role: 'Co-Founder, CTO',
salary: 95_000,
location: 'Australia',
engagement: 'Full-Time',
engagement: msg`Full-Time`,
joinDate: 'April 19th, 2023',
},
{
@ -20,7 +22,7 @@ export const TEAM_MEMBERS = [
role: 'Software Engineer - Intern',
salary: 15_000,
location: 'Ghana',
engagement: 'Part-Time',
engagement: msg`Part-Time`,
joinDate: 'June 6th, 2023',
},
{
@ -28,7 +30,7 @@ export const TEAM_MEMBERS = [
role: 'Software Engineer - III',
salary: 100_000,
location: 'Australia',
engagement: 'Full-Time',
engagement: msg`Full-Time`,
joinDate: 'July 26th, 2023',
},
{
@ -36,7 +38,7 @@ export const TEAM_MEMBERS = [
role: 'Software Engineer - II',
salary: 80_000,
location: 'Romania',
engagement: 'Full-Time',
engagement: msg`Full-Time`,
joinDate: 'September 4th, 2023',
},
{
@ -44,7 +46,7 @@ export const TEAM_MEMBERS = [
role: 'Designer - III',
salary: 100_000,
location: 'India',
engagement: 'Full-Time',
engagement: msg`Full-Time`,
joinDate: 'October 9th, 2023',
},
];

View File

@ -2,6 +2,8 @@
import type { HTMLAttributes } from 'react';
import { Trans, msg } from '@lingui/macro';
import { useLingui } from '@lingui/react';
import { Bar, BarChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
import { formatMonth } from '@documenso/lib/client-only/format-month';
@ -11,6 +13,8 @@ export type FundingRaisedProps = HTMLAttributes<HTMLDivElement> & {
};
export const FundingRaised = ({ className, data, ...props }: FundingRaisedProps) => {
const { _ } = useLingui();
const formattedData = data.map((item) => ({
amount: Number(item.amount),
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
@ -21,7 +25,9 @@ export const FundingRaised = ({ className, data, ...props }: FundingRaisedProps)
<div className={className} {...props}>
<div className="border-border flex flex-col justify-center rounded-2xl border p-6 pl-2 shadow-sm hover:shadow">
<div className="mb-6 flex px-4">
<h3 className="text-lg font-semibold">Total Funding Raised</h3>
<h3 className="text-lg font-semibold">
<Trans>Total Funding Raised</Trans>
</h3>
</div>
<ResponsiveContainer width="100%" height={400}>
@ -49,14 +55,14 @@ export const FundingRaised = ({ className, data, ...props }: FundingRaisedProps)
currency: 'USD',
maximumFractionDigits: 0,
}),
'Amount Raised',
_(msg`Amount Raised`),
]}
cursor={{ fill: 'hsl(var(--primary) / 10%)' }}
/>
<Bar
dataKey="amount"
fill="hsl(var(--primary))"
label="Amount Raised"
label={_(msg`Amount Raised`)}
maxBarSize={60}
radius={[4, 4, 0, 0]}
/>

View File

@ -1,5 +1,7 @@
'use client';
import { Trans, msg } from '@lingui/macro';
import { useLingui } from '@lingui/react';
import { DateTime } from 'luxon';
import { Bar, BarChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
@ -14,6 +16,8 @@ export const MonthlyCompletedDocumentsChart = ({
className,
data,
}: MonthlyCompletedDocumentsChartProps) => {
const { _ } = useLingui();
const formattedData = [...data].reverse().map(({ month, count }) => {
return {
month: DateTime.fromFormat(month, 'yyyy-MM').toFormat('LLLL'),
@ -25,7 +29,9 @@ export const MonthlyCompletedDocumentsChart = ({
<div className={className}>
<div className="border-border flex flex-col justify-center rounded-2xl border p-6 pl-2 shadow-sm hover:shadow">
<div className="mb-6 flex px-4">
<h3 className="text-lg font-semibold">Completed Documents per Month</h3>
<h3 className="text-lg font-semibold">
<Trans>Completed Documents per Month</Trans>
</h3>
</div>
<ResponsiveContainer width="100%" height={400}>
@ -46,7 +52,7 @@ export const MonthlyCompletedDocumentsChart = ({
fill="hsl(var(--primary))"
radius={[4, 4, 0, 0]}
maxBarSize={60}
label="Completed Documents"
label={_(msg`Completed Documents`)}
/>
</BarChart>
</ResponsiveContainer>

View File

@ -1,5 +1,7 @@
'use client';
import { Trans, msg } from '@lingui/macro';
import { useLingui } from '@lingui/react';
import { DateTime } from 'luxon';
import { Bar, BarChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
@ -11,6 +13,8 @@ export type MonthlyNewUsersChartProps = {
};
export const MonthlyNewUsersChart = ({ className, data }: MonthlyNewUsersChartProps) => {
const { _ } = useLingui();
const formattedData = [...data].reverse().map(({ month, count }) => {
return {
month: DateTime.fromFormat(month, 'yyyy-MM').toFormat('LLLL'),
@ -22,7 +26,9 @@ export const MonthlyNewUsersChart = ({ className, data }: MonthlyNewUsersChartPr
<div className={className}>
<div className="border-border flex flex-col justify-center rounded-2xl border p-6 pl-2 shadow-sm hover:shadow">
<div className="mb-6 flex px-4">
<h3 className="text-lg font-semibold">New Users</h3>
<h3 className="text-lg font-semibold">
<Trans>New Users</Trans>
</h3>
</div>
<ResponsiveContainer width="100%" height={400}>
@ -34,7 +40,7 @@ export const MonthlyNewUsersChart = ({ className, data }: MonthlyNewUsersChartPr
labelStyle={{
color: 'hsl(var(--primary-foreground))',
}}
formatter={(value) => [Number(value).toLocaleString('en-US'), 'New Users']}
formatter={(value) => [Number(value).toLocaleString('en-US'), _(msg`New Users`)]}
cursor={{ fill: 'hsl(var(--primary) / 10%)' }}
/>
@ -43,7 +49,7 @@ export const MonthlyNewUsersChart = ({ className, data }: MonthlyNewUsersChartPr
fill="hsl(var(--primary))"
radius={[4, 4, 0, 0]}
maxBarSize={60}
label="New Users"
label={_(msg`New Users`)}
/>
</BarChart>
</ResponsiveContainer>

View File

@ -1,5 +1,7 @@
'use client';
import { Trans, msg } from '@lingui/macro';
import { useLingui } from '@lingui/react';
import { DateTime } from 'luxon';
import { Bar, BarChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
@ -11,6 +13,8 @@ export type MonthlyTotalUsersChartProps = {
};
export const MonthlyTotalUsersChart = ({ className, data }: MonthlyTotalUsersChartProps) => {
const { _ } = useLingui();
const formattedData = [...data].reverse().map(({ month, cume_count: count }) => {
return {
month: DateTime.fromFormat(month, 'yyyy-MM').toFormat('LLLL'),
@ -22,7 +26,9 @@ export const MonthlyTotalUsersChart = ({ className, data }: MonthlyTotalUsersCha
<div className={className}>
<div className="border-border flex flex-1 flex-col justify-center rounded-2xl border p-6 pl-2 shadow-sm hover:shadow">
<div className="mb-6 flex px-4">
<h3 className="text-lg font-semibold">Total Users</h3>
<h3 className="text-lg font-semibold">
<Trans>Total Users</Trans>
</h3>
</div>
<ResponsiveContainer width="100%" height={400}>
@ -34,7 +40,7 @@ export const MonthlyTotalUsersChart = ({ className, data }: MonthlyTotalUsersCha
labelStyle={{
color: 'hsl(var(--primary-foreground))',
}}
formatter={(value) => [Number(value).toLocaleString('en-US'), 'Total Users']}
formatter={(value) => [Number(value).toLocaleString('en-US'), _(msg`Total Users`)]}
cursor={{ fill: 'hsl(var(--primary) / 10%)' }}
/>
@ -43,7 +49,7 @@ export const MonthlyTotalUsersChart = ({ className, data }: MonthlyTotalUsersCha
fill="hsl(var(--primary))"
radius={[4, 4, 0, 0]}
maxBarSize={60}
label="Total Users"
label={_(msg`Total Users`)}
/>
</BarChart>
</ResponsiveContainer>

View File

@ -1,7 +1,10 @@
import type { Metadata } from 'next';
import { Trans, msg } from '@lingui/macro';
import { useLingui } from '@lingui/react';
import { z } from 'zod';
import { setupI18nSSR } from '@documenso/lib/client-only/providers/i18n.server';
import { getCompletedDocumentsMonthly } from '@documenso/lib/server-only/user/get-monthly-completed-document';
import { getUserMonthlyGrowth } from '@documenso/lib/server-only/user/get-user-monthly-growth';
@ -128,6 +131,10 @@ const fetchEarlyAdopters = async () => {
};
export default async function OpenPage() {
setupI18nSSR();
const { _ } = useLingui();
const [
{ forks_count: forksCount, stargazers_count: stargazersCount },
{ total_count: openIssues },
@ -150,19 +157,23 @@ export default async function OpenPage() {
<div>
<div className="mx-auto mt-6 max-w-screen-lg sm:mt-12">
<div className="flex flex-col items-center justify-center">
<h1 className="text-3xl font-bold lg:text-5xl">Open Startup</h1>
<h1 className="text-3xl font-bold lg:text-5xl">
<Trans>Open Startup</Trans>
</h1>
<p className="text-muted-foreground mt-4 max-w-[60ch] text-center text-lg leading-normal">
All our metrics, finances, and learnings are public. We believe in transparency and want
to share our journey with you. You can read more about why here:{' '}
<a
className="font-bold"
href="https://documenso.com/blog/pre-seed"
target="_blank"
rel="noreferrer"
>
Announcing Open Metrics
</a>
<Trans>
All our metrics, finances, and learnings are public. We believe in transparency and
want to share our journey with you. You can read more about why here:{' '}
<a
className="font-bold"
href="https://documenso.com/blog/pre-seed"
target="_blank"
rel="noreferrer"
>
Announcing Open Metrics
</a>
</Trans>
</p>
</div>
@ -180,12 +191,12 @@ export default async function OpenPage() {
/>
<MetricCard
className="col-span-2 lg:col-span-1"
title="Open Issues"
title={_(msg`Open Issues`)}
value={openIssues.toLocaleString('en-US')}
/>
<MetricCard
className="col-span-2 lg:col-span-1"
title="Merged PR's"
title={_(msg`Merged PR's`)}
value={mergedPullRequests.toLocaleString('en-US')}
/>
</div>
@ -195,28 +206,32 @@ export default async function OpenPage() {
<SalaryBands className="col-span-12" />
</div>
<h2 className="px-4 text-2xl font-semibold">Finances</h2>
<h2 className="px-4 text-2xl font-semibold">
<Trans>Finances</Trans>
</h2>
<div className="mb-12 mt-4 grid grid-cols-12 gap-8">
<FundingRaised data={FUNDING_RAISED} className="col-span-12 lg:col-span-6" />
<CapTable className="col-span-12 lg:col-span-6" />
</div>
<h2 className="px-4 text-2xl font-semibold">Community</h2>
<h2 className="px-4 text-2xl font-semibold">
<Trans>Community</Trans>
</h2>
<div className="mb-12 mt-4 grid grid-cols-12 gap-8">
<BarMetric<StargazersType>
data={STARGAZERS_DATA}
metricKey="stars"
title="GitHub: Total Stars"
label="Stars"
title={_(msg`GitHub: Total Stars`)}
label={_(msg`Stars`)}
className="col-span-12 lg:col-span-6"
/>
<BarMetric<StargazersType>
data={STARGAZERS_DATA}
metricKey="mergedPRs"
title="GitHub: Total Merged PRs"
label="Merged PRs"
title={_(msg`GitHub: Total Merged PRs`)}
label={_(msg`Merged PRs`)}
chartHeight={400}
className="col-span-12 lg:col-span-6"
/>
@ -233,8 +248,8 @@ export default async function OpenPage() {
<BarMetric<StargazersType>
data={STARGAZERS_DATA}
metricKey="openIssues"
title="GitHub: Total Open Issues"
label="Open Issues"
title={_(msg`GitHub: Total Open Issues`)}
label={_(msg`Open Issues`)}
chartHeight={400}
className="col-span-12 lg:col-span-6"
/>
@ -242,13 +257,15 @@ export default async function OpenPage() {
<Typefully className="col-span-12 lg:col-span-6" />
</div>
<h2 className="px-4 text-2xl font-semibold">Growth</h2>
<h2 className="px-4 text-2xl font-semibold">
<Trans>Growth</Trans>
</h2>
<div className="mb-12 mt-4 grid grid-cols-12 gap-8">
<BarMetric<EarlyAdoptersType>
data={EARLY_ADOPTERS_DATA}
metricKey="earlyAdopters"
title="Total Customers"
label="Total Customers"
title={_(msg`Total Customers`)}
label={_(msg`Total Customers`)}
className="col-span-12 lg:col-span-6"
extraInfo={<OpenPageTooltip />}
/>
@ -268,11 +285,15 @@ export default async function OpenPage() {
</div>
<div className="col-span-12 mt-12 flex flex-col items-center justify-center">
<h2 className="text-2xl font-bold">Is there more?</h2>
<h2 className="text-2xl font-bold">
<Trans>Is there more?</Trans>
</h2>
<p className="text-muted-foreground mt-4 max-w-[55ch] text-center text-lg leading-normal">
This page is evolving as we learn what makes a great signing company. We'll update it when
we have more to share.
<Trans>
This page is evolving as we learn what makes a great signing company. We'll update it
when we have more to share.
</Trans>
</p>
</div>

View File

@ -1,5 +1,7 @@
import type { HTMLAttributes } from 'react';
import { Trans } from '@lingui/macro';
import { cn } from '@documenso/ui/lib/utils';
import {
Table,
@ -17,15 +19,23 @@ export type SalaryBandsProps = HTMLAttributes<HTMLDivElement>;
export const SalaryBands = ({ className, ...props }: SalaryBandsProps) => {
return (
<div className={cn('flex flex-col', className)} {...props}>
<h3 className="px-4 text-lg font-semibold">Global Salary Bands</h3>
<h3 className="px-4 text-lg font-semibold">
<Trans>Global Salary Bands</Trans>
</h3>
<div className="border-border mt-2.5 flex-1 rounded-2xl border shadow-sm hover:shadow">
<Table>
<TableHeader>
<TableRow>
<TableHead className="w-[200px]">Title</TableHead>
<TableHead>Seniority</TableHead>
<TableHead className="w-[100px] text-right">Salary</TableHead>
<TableHead className="w-[200px]">
<Trans>Title</Trans>
</TableHead>
<TableHead>
<Trans>Seniority</Trans>
</TableHead>
<TableHead className="w-[100px] text-right">
<Trans>Salary</Trans>
</TableHead>
</TableRow>
</TableHeader>
<TableBody>

View File

@ -1,5 +1,8 @@
import type { HTMLAttributes } from 'react';
import { Trans } from '@lingui/macro';
import { useLingui } from '@lingui/react';
import { cn } from '@documenso/ui/lib/utils';
import {
Table,
@ -15,20 +18,36 @@ import { TEAM_MEMBERS } from './data';
export type TeamMembersProps = HTMLAttributes<HTMLDivElement>;
export const TeamMembers = ({ className, ...props }: TeamMembersProps) => {
const { _ } = useLingui();
return (
<div className={cn('flex flex-col', className)} {...props}>
<h2 className="px-4 text-2xl font-semibold">Team</h2>
<h2 className="px-4 text-2xl font-semibold">
<Trans>Team</Trans>
</h2>
<div className="border-border mt-2.5 flex-1 rounded-2xl border shadow-sm hover:shadow">
<Table>
<TableHeader>
<TableRow>
<TableHead className="">Name</TableHead>
<TableHead>Role</TableHead>
<TableHead>Salary</TableHead>
<TableHead>Engagement</TableHead>
<TableHead>Location</TableHead>
<TableHead className="w-[100px] text-right">Join Date</TableHead>
<TableHead>
<Trans>Name</Trans>
</TableHead>
<TableHead>
<Trans>Role</Trans>
</TableHead>
<TableHead>
<Trans>Salary</Trans>
</TableHead>
<TableHead>
<Trans>Engagement</Trans>
</TableHead>
<TableHead>
<Trans>Location</Trans>
</TableHead>
<TableHead className="w-[100px] text-right">
<Trans>Join Date</Trans>
</TableHead>
</TableRow>
</TableHeader>
<TableBody>
@ -44,7 +63,7 @@ export const TeamMembers = ({ className, ...props }: TeamMembersProps) => {
maximumFractionDigits: 0,
})}
</TableCell>
<TableCell>{member.engagement}</TableCell>
<TableCell>{_(member.engagement)}</TableCell>
<TableCell>{member.location}</TableCell>
<TableCell className="text-right">{member.joinDate}</TableCell>
</TableRow>

View File

@ -1,5 +1,7 @@
import React from 'react';
import { Trans } from '@lingui/macro';
import {
Tooltip,
TooltipContent,
@ -29,7 +31,9 @@ export function OpenPageTooltip() {
</svg>
</TooltipTrigger>
<TooltipContent>
<p>Customers with an Active Subscriptions.</p>
<p>
<Trans>Customers with an Active Subscriptions.</Trans>
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>

View File

@ -1,5 +1,7 @@
'use client';
import { Trans, msg } from '@lingui/macro';
import { useLingui } from '@lingui/react';
import { DateTime } from 'luxon';
import { Bar, BarChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
@ -11,6 +13,8 @@ export type TotalSignedDocumentsChartProps = {
};
export const TotalSignedDocumentsChart = ({ className, data }: TotalSignedDocumentsChartProps) => {
const { _ } = useLingui();
const formattedData = [...data].reverse().map(({ month, cume_count: count }) => {
return {
month: DateTime.fromFormat(month, 'yyyy-MM').toFormat('LLLL'),
@ -22,7 +26,9 @@ export const TotalSignedDocumentsChart = ({ className, data }: TotalSignedDocume
<div className={className}>
<div className="border-border flex flex-col justify-center rounded-2xl border p-6 pl-2 shadow-sm hover:shadow">
<div className="mb-6 flex px-4">
<h3 className="text-lg font-semibold">Total Completed Documents</h3>
<h3 className="text-lg font-semibold">
<Trans>Total Completed Documents</Trans>
</h3>
</div>
<ResponsiveContainer width="100%" height={400}>
@ -46,7 +52,7 @@ export const TotalSignedDocumentsChart = ({ className, data }: TotalSignedDocume
fill="hsl(var(--primary))"
radius={[4, 4, 0, 0]}
maxBarSize={60}
label="Total Completed Documents"
label={_(msg`Total Completed Documents`)}
/>
</BarChart>
</ResponsiveContainer>

View File

@ -4,6 +4,7 @@ import type { HTMLAttributes } from 'react';
import Link from 'next/link';
import { Trans } from '@lingui/macro';
import { FaXTwitter } from 'react-icons/fa6';
import { Button } from '@documenso/ui/primitives/button';
@ -15,22 +16,26 @@ export const Typefully = ({ className, ...props }: TypefullyProps) => {
<div className={className} {...props}>
<div className="border-border flex flex-col justify-center rounded-2xl border p-6 pl-2 shadow-sm hover:shadow">
<div className="mb-6 flex px-4">
<h3 className="text-lg font-semibold">Twitter Stats</h3>
<h3 className="text-lg font-semibold">
<Trans>Twitter Stats</Trans>
</h3>
</div>
<div className="my-12 flex flex-col items-center gap-y-4 text-center">
<FaXTwitter className="h-12 w-12" />
<Link href="https://typefully.com/documenso/stats" target="_blank">
<h1>Documenso on X</h1>
<h1>
<Trans>Documenso on X</Trans>
</h1>
</Link>
<Button className="rounded-full" size="sm" asChild>
<Link href="https://typefully.com/documenso/stats" target="_blank">
View all stats
<Trans>View all stats</Trans>
</Link>
</Button>
<Button className="rounded-full bg-white" size="sm" asChild>
<Link href="https://twitter.com/documenso" target="_blank">
Follow us on X
<Trans>Follow us on X</Trans>
</Link>
</Button>
</div>

View File

@ -2,6 +2,7 @@
import type { Metadata } from 'next';
import { Caveat } from 'next/font/google';
import { setupI18nSSR } from '@documenso/lib/client-only/providers/i18n.server';
import { cn } from '@documenso/ui/lib/utils';
import { Callout } from '~/components/(marketing)/callout';
@ -25,6 +26,8 @@ const fontCaveat = Caveat({
});
export default async function IndexPage() {
setupI18nSSR();
const starCount = await fetch('https://api.github.com/repos/documenso/documenso', {
headers: {
accept: 'application/vnd.github.v3+json',

View File

@ -1,6 +1,9 @@
import type { Metadata } from 'next';
import Link from 'next/link';
import { Trans } from '@lingui/macro';
import { setupI18nSSR } from '@documenso/lib/client-only/providers/i18n.server';
import {
Accordion,
AccordionContent,
@ -28,15 +31,21 @@ export type PricingPageProps = {
};
export default function PricingPage() {
setupI18nSSR();
return (
<div className="mt-6 sm:mt-12">
<div className="text-center">
<h1 className="text-3xl font-bold lg:text-5xl">Pricing</h1>
<h1 className="text-3xl font-bold lg:text-5xl">
<Trans>Pricing</Trans>
</h1>
<p className="text-foreground mt-4 text-lg leading-normal">
Designed for every stage of your journey.
<Trans>Designed for every stage of your journey.</Trans>
</p>
<p className="text-foreground text-lg leading-normal">
<Trans>Get started today.</Trans>
</p>
<p className="text-foreground text-lg leading-normal">Get started today.</p>
</div>
<div className="mt-12">
@ -49,19 +58,21 @@ export default function PricingPage() {
<div className="mx-auto mt-36 max-w-2xl">
<h2 className="text-center text-2xl font-semibold">
None of these work for you? Try self-hosting!
<Trans>None of these work for you? Try self-hosting!</Trans>
</h2>
<p className="text-muted-foreground mt-4 text-center leading-relaxed">
Our self-hosted option is great for small teams and individuals who need a simple
solution. You can use our docker based setup to get started in minutes. Take control with
full customizability and data ownership.
<Trans>
Our self-hosted option is great for small teams and individuals who need a simple
solution. You can use our docker based setup to get started in minutes. Take control
with full customizability and data ownership.
</Trans>
</p>
<div className="mt-4 flex justify-center">
<Button variant="outline" size="lg" className="rounded-full hover:cursor-pointer" asChild>
<Link href="https://github.com/documenso/documenso" target="_blank" rel="noreferrer">
Get Started
<Trans>Get Started</Trans>
</Link>
</Button>
</div>
@ -75,120 +86,134 @@ export default function PricingPage() {
<Accordion type="multiple" className="mt-8">
<AccordionItem value="plan-differences">
<AccordionTrigger className="text-left text-lg font-semibold">
What is the difference between the plans?
<Trans>What is the difference between the plans?</Trans>
</AccordionTrigger>
<AccordionContent className="text-muted-foreground max-w-prose text-sm leading-relaxed">
You can self-host Documenso for free or use our ready-to-use hosted version. The
hosted version comes with additional support, painless scalability and more. Early
adopters will get access to all features we build this year, for no additional cost!
Forever! Yes, that includes multiple users per account later. If you want Documenso
for your enterprise, we are happy to talk about your needs.
<Trans>
You can self-host Documenso for free or use our ready-to-use hosted version. The
hosted version comes with additional support, painless scalability and more. Early
adopters will get access to all features we build this year, for no additional cost!
Forever! Yes, that includes multiple users per account later. If you want Documenso
for your enterprise, we are happy to talk about your needs.
</Trans>
</AccordionContent>
</AccordionItem>
<AccordionItem value="data-handling">
<AccordionTrigger className="text-left text-lg font-semibold">
How do you handle my data?
<Trans>How do you handle my data?</Trans>
</AccordionTrigger>
<AccordionContent className="text-muted-foreground max-w-prose text-sm leading-relaxed">
Securely. Our data centers are located in Frankfurt (Germany), giving us the best
local privacy laws. We are very aware of the sensitive nature of our data and follow
best practices to ensure the security and integrity of the data entrusted to us.
<Trans>
Securely. Our data centers are located in Frankfurt (Germany), giving us the best
local privacy laws. We are very aware of the sensitive nature of our data and follow
best practices to ensure the security and integrity of the data entrusted to us.
</Trans>
</AccordionContent>
</AccordionItem>
<AccordionItem value="should-use-cloud">
<AccordionTrigger className="text-left text-lg font-semibold">
Why should I use your hosting service?
<Trans>Why should I use your hosting service?</Trans>
</AccordionTrigger>
<AccordionContent className="text-muted-foreground max-w-prose text-sm leading-relaxed">
Using our hosted version is the easiest way to get started, you can simply subscribe
and start signing your documents. We take care of the infrastructure, so you can focus
on your business. Additionally, when using our hosted version you benefit from our
trusted signing certificates which helps you to build trust with your customers.
<Trans>
Using our hosted version is the easiest way to get started, you can simply subscribe
and start signing your documents. We take care of the infrastructure, so you can
focus on your business. Additionally, when using our hosted version you benefit from
our trusted signing certificates which helps you to build trust with your customers.
</Trans>
</AccordionContent>
</AccordionItem>
<AccordionItem value="how-to-contribute">
<AccordionTrigger className="text-left text-lg font-semibold">
How can I contribute?
<Trans>How can I contribute?</Trans>
</AccordionTrigger>
<AccordionContent className="text-muted-foreground max-w-prose text-sm leading-relaxed">
That's awesome. You can take a look at the current{' '}
<Link
className="text-documenso-700 font-bold"
href="https://github.com/documenso/documenso/milestones"
target="_blank"
>
Issues
</Link>{' '}
and join our{' '}
<Link
className="text-documenso-700 font-bold"
href="https://documen.so/discord"
target="_blank"
>
Discord Community
</Link>{' '}
to keep up to date, on what the current priorities are. In any case, we are an open
community and welcome all input, technical and non-technical ❤️
<Trans>
That's awesome. You can take a look at the current{' '}
<Link
className="text-documenso-700 font-bold"
href="https://github.com/documenso/documenso/milestones"
target="_blank"
>
Issues
</Link>{' '}
and join our{' '}
<Link
className="text-documenso-700 font-bold"
href="https://documen.so/discord"
target="_blank"
>
Discord Community
</Link>{' '}
to keep up to date, on what the current priorities are. In any case, we are an open
community and welcome all input, technical and non-technical ❤️
</Trans>
</AccordionContent>
</AccordionItem>
<AccordionItem value="can-i-use-documenso-commercially">
<AccordionTrigger className="text-left text-lg font-semibold">
Can I use Documenso commercially?
<Trans>Can I use Documenso commercially?</Trans>
</AccordionTrigger>
<AccordionContent className="text-muted-foreground max-w-prose text-sm leading-relaxed">
Yes! Documenso is offered under the GNU AGPL V3 open source license. This means you
can use it for free and even modify it to fit your needs, as long as you publish your
changes under the same license.
<Trans>
Yes! Documenso is offered under the GNU AGPL V3 open source license. This means you
can use it for free and even modify it to fit your needs, as long as you publish
your changes under the same license.
</Trans>
</AccordionContent>
</AccordionItem>
<AccordionItem value="why-prefer-documenso">
<AccordionTrigger className="text-left text-lg font-semibold">
Why should I prefer Documenso over DocuSign or some other signing tool?
<Trans>Why should I prefer Documenso over DocuSign or some other signing tool?</Trans>
</AccordionTrigger>
<AccordionContent className="text-muted-foreground max-w-prose text-sm leading-relaxed">
Documenso is a community effort to create an open and vibrant ecosystem around a tool,
everybody is free to use and adapt. By being truly open we want to create trusted
infrastructure for the future of the internet.
<Trans>
Documenso is a community effort to create an open and vibrant ecosystem around a
tool, everybody is free to use and adapt. By being truly open we want to create
trusted infrastructure for the future of the internet.
</Trans>
</AccordionContent>
</AccordionItem>
<AccordionItem value="where-can-i-get-support">
<AccordionTrigger className="text-left text-lg font-semibold">
Where can I get support?
<Trans>Where can I get support?</Trans>
</AccordionTrigger>
<AccordionContent className="text-muted-foreground max-w-prose text-sm leading-relaxed">
We are happy to assist you at{' '}
<Link
className="text-documenso-700 font-bold"
target="_blank"
rel="noreferrer"
href="mailto:support@documenso.com"
>
support@documenso.com
</Link>{' '}
or{' '}
<a
className="text-documenso-700 font-bold"
href="https://documen.so/discord"
target="_blank"
rel="noreferrer"
>
in our Discord-Support-Channel
</a>{' '}
please message either Lucas or Timur to get added to the channel if you are not
already a member.
<Trans>
We are happy to assist you at{' '}
<Link
className="text-documenso-700 font-bold"
target="_blank"
rel="noreferrer"
href="mailto:support@documenso.com"
>
support@documenso.com
</Link>{' '}
or{' '}
<a
className="text-documenso-700 font-bold"
href="https://documen.so/discord"
target="_blank"
rel="noreferrer"
>
in our Discord-Support-Channel
</a>{' '}
please message either Lucas or Timur to get added to the channel if you are not
already a member.
</Trans>
</AccordionContent>
</AccordionItem>
</Accordion>

View File

@ -1,12 +1,17 @@
import { Suspense } from 'react';
import { Caveat, Inter } from 'next/font/google';
import { cookies, headers } from 'next/headers';
import { AxiomWebVitals } from 'next-axiom';
import { PublicEnvScript } from 'next-runtime-env';
import { FeatureFlagProvider } from '@documenso/lib/client-only/providers/feature-flag';
import { I18nClientProvider } from '@documenso/lib/client-only/providers/i18n.client';
import { setupI18nSSR } from '@documenso/lib/client-only/providers/i18n.server';
import { NEXT_PUBLIC_MARKETING_URL } from '@documenso/lib/constants/app';
import type { SUPPORTED_LANGUAGE_CODES } from '@documenso/lib/constants/i18n';
import { ZSupportedLanguageCodeSchema } from '@documenso/lib/constants/i18n';
import { getAllAnonymousFlags } from '@documenso/lib/universal/get-feature-flag';
import { TrpcProvider } from '@documenso/trpc/react';
import { cn } from '@documenso/ui/lib/utils';
@ -54,9 +59,29 @@ export function generateMetadata() {
export default async function RootLayout({ children }: { children: React.ReactNode }) {
const flags = await getAllAnonymousFlags();
let overrideLang: (typeof SUPPORTED_LANGUAGE_CODES)[number] | undefined;
// Should be safe to remove when we upgrade NextJS.
// https://github.com/vercel/next.js/pull/65008
// Currently if the middleware sets the cookie, it's not accessible in the cookies
// during the same render.
// So we go the roundabout way of checking the header for the set-cookie value.
if (!cookies().get('i18n')) {
const setCookieValue = headers().get('set-cookie');
const i18nCookie = setCookieValue?.split(';').find((cookie) => cookie.startsWith('i18n='));
if (i18nCookie) {
const i18n = i18nCookie.split('=')[1];
overrideLang = ZSupportedLanguageCodeSchema.parse(i18n);
}
}
const { lang, i18n } = setupI18nSSR(overrideLang);
return (
<html
lang="en"
lang={lang}
className={cn(fontInter.variable, fontCaveat.variable)}
suppressHydrationWarning
>
@ -65,6 +90,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="manifest" href="/site.webmanifest" />
<meta name="google" content="notranslate" />
<PublicEnvScript />
</head>
@ -78,7 +104,11 @@ export default async function RootLayout({ children }: { children: React.ReactNo
<FeatureFlagProvider initialFlags={flags}>
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
<PlausibleProvider>
<TrpcProvider>{children}</TrpcProvider>
<TrpcProvider>
<I18nClientProvider initialLocale={lang} initialMessages={i18n.messages}>
{children}
</I18nClientProvider>
</TrpcProvider>
</PlausibleProvider>
</ThemeProvider>
</FeatureFlagProvider>