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,5 +1,7 @@
import Link from 'next/link';
import { Trans } from '@lingui/macro';
import { NEXT_PUBLIC_WEBAPP_URL } from '@documenso/lib/constants/app';
import { Button } from '@documenso/ui/primitives/button';
import { Card, CardContent } from '@documenso/ui/primitives/card';
@ -13,16 +15,20 @@ export const CallToAction = ({ className, utmSource = 'generic-cta' }: CallToAct
return (
<Card spotlight className={className}>
<CardContent className="flex flex-col items-center justify-center p-12">
<h2 className="text-center text-2xl font-bold">Join the Open Signing Movement</h2>
<h2 className="text-center text-2xl font-bold">
<Trans>Join the Open Signing Movement</Trans>
</h2>
<p className="text-muted-foreground mt-4 max-w-[55ch] text-center leading-normal">
Create your account and start using state-of-the-art document signing. Open and beautiful
signing is within your grasp.
<Trans>
Create your account and start using state-of-the-art document signing. Open and
beautiful signing is within your grasp.
</Trans>
</p>
<Button className="mt-8 rounded-full no-underline" size="lg" asChild>
<Link href={`${NEXT_PUBLIC_WEBAPP_URL()}/signup?utm_source=${utmSource}`} target="_blank">
Get started
<Trans>Get started</Trans>
</Link>
</Button>
</CardContent>

View File

@ -2,6 +2,7 @@
import Link from 'next/link';
import { Trans } from '@lingui/macro';
import { usePlausible } from 'next-plausible';
import { LuGithub } from 'react-icons/lu';
@ -15,23 +16,6 @@ export type CalloutProps = {
export const Callout = ({ starCount }: CalloutProps) => {
const event = usePlausible();
const onSignUpClick = () => {
const el = document.getElementById('email');
if (el) {
const { top } = el.getBoundingClientRect();
window.scrollTo({
top: top - 120,
behavior: 'smooth',
});
setTimeout(() => {
el.focus();
}, 500);
}
};
return (
<div className="mt-8 flex flex-wrap items-center justify-center gap-x-6 gap-y-4">
<Link href="https://app.documenso.com/signup?utm_source=marketing-callout">
@ -40,9 +24,9 @@ export const Callout = ({ starCount }: CalloutProps) => {
variant="outline"
className="rounded-full bg-transparent backdrop-blur-sm"
>
Try our Free Plan
<Trans>Try our Free Plan</Trans>
<span className="bg-primary dark:text-background -mr-2.5 ml-2.5 rounded-full px-2 py-1.5 text-xs font-medium">
No Credit Card required
<Trans>No Credit Card required</Trans>
</span>
</Button>
</Link>

View File

@ -2,6 +2,9 @@
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { Trans, msg } from '@lingui/macro';
import { useLingui } from '@lingui/react';
import type { AutoplayType } from 'embla-carousel-autoplay';
import Autoplay from 'embla-carousel-autoplay';
import useEmblaCarousel from 'embla-carousel-react';
import { useTheme } from 'next-themes';
@ -13,13 +16,13 @@ import { Slide } from './slide';
const SLIDES = [
{
label: 'Signing Process',
label: msg`Signing Process`,
type: 'video',
srcLight: 'https://github.com/documenso/design/raw/main/marketing/signing.webm',
srcDark: 'https://github.com/documenso/design/raw/main/marketing/dark/signing.webm',
},
{
label: 'Teams',
label: msg`Teams`,
type: 'video',
srcLight: 'https://github.com/documenso/design/raw/main/marketing/teams.webm',
srcDark: 'https://github.com/documenso/design/raw/main/marketing/dark/teams.webm',
@ -31,7 +34,7 @@ const SLIDES = [
srcDark: 'https://github.com/documenso/design/raw/main/marketing/dark/zapier.webm',
},
{
label: 'Direct Link',
label: msg`Direct Link`,
type: 'video',
srcLight: 'https://github.com/documenso/design/raw/main/marketing/direct-links.webm',
srcDark: 'https://github.com/documenso/design/raw/main/marketing/dark/direct-links.webm',
@ -49,7 +52,7 @@ const SLIDES = [
srcDark: 'https://github.com/documenso/design/raw/main/marketing/dark/api.webm',
},
{
label: 'Profile',
label: msg`Profile`,
type: 'video',
srcLight: 'https://github.com/documenso/design/raw/main/marketing/profile_teaser.webm',
srcDark: 'https://github.com/documenso/design/raw/main/marketing/dark/profile_teaser.webm',
@ -57,6 +60,8 @@ const SLIDES = [
];
export const Carousel = () => {
const { _ } = useLingui();
const slides = SLIDES;
const [_isPlaying, setIsPlaying] = useState(false);
const [selectedIndex, setSelectedIndex] = useState(0);
@ -73,6 +78,7 @@ export const Carousel = () => {
const [emblaRef, emblaApi] = useEmblaCarousel({ loop: true }, [
Autoplay({ playOnInit: true, delay: autoplayDelay[selectedIndex] || 5000 }),
]);
const [emblaThumbsRef, emblaThumbsApi] = useEmblaCarousel(
{
loop: true,
@ -84,19 +90,28 @@ export const Carousel = () => {
const onThumbClick = useCallback(
(index: number) => {
if (!emblaApi || !emblaThumbsApi) return;
if (!emblaApi || !emblaThumbsApi) {
return;
}
emblaApi.scrollTo(index);
},
[emblaApi, emblaThumbsApi],
);
const onSelect = useCallback(() => {
if (!emblaApi || !emblaThumbsApi) return;
if (!emblaApi || !emblaThumbsApi) {
return;
}
setSelectedIndex(emblaApi.selectedScrollSnap());
emblaThumbsApi.scrollTo(emblaApi.selectedScrollSnap());
resetProgress();
const autoplay = emblaApi.plugins()?.autoplay;
// moduleResolution: bundler breaks this type
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
const autoplay = emblaApi.plugins()?.autoplay as unknown as AutoplayType | undefined;
if (autoplay) {
autoplay.reset();
@ -167,11 +182,18 @@ export const Carousel = () => {
}, [emblaApi, onSelect, mounted, resolvedTheme]);
useEffect(() => {
const autoplay = emblaApi?.plugins()?.autoplay;
if (!autoplay) return;
// moduleResolution: bundler breaks this type
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
const autoplay = emblaApi?.plugins()?.autoplay as unknown as AutoplayType | undefined;
if (!autoplay || !emblaApi) {
return;
}
setIsPlaying(autoplay.isPlaying());
emblaApi
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(emblaApi as unknown as any)
.on('autoplay:play', () => setIsPlaying(true))
.on('autoplay:stop', () => setIsPlaying(false))
.on('reInit', () => setIsPlaying(autoplay.isPlaying()));
@ -233,7 +255,7 @@ export const Carousel = () => {
src={resolvedTheme === 'dark' ? slide.srcDark : slide.srcLight}
type="video/webm"
/>
Your browser does not support the video tag.
<Trans>Your browser does not support the video tag.</Trans>
</video>
)}
</div>
@ -257,7 +279,7 @@ export const Carousel = () => {
onClick={() => onThumbClick(index)}
selected={index === selectedIndex}
index={index}
label={slide.label}
label={typeof slide.label === 'string' ? slide.label : _(slide.label)}
/>
))}
</div>

View File

@ -2,6 +2,7 @@
import Link from 'next/link';
import { Trans } from '@lingui/macro';
import { usePlausible } from 'next-plausible';
import { Button } from '@documenso/ui/primitives/button';
@ -12,13 +13,15 @@ export const Enterprise = () => {
return (
<div className="mx-auto mt-36 max-w-2xl">
<h2 className="text-center text-2xl font-semibold">
Enterprise Compliance, License or Technical Needs?
<Trans>Enterprise Compliance, License or Technical Needs?</Trans>
</h2>
<p className="text-muted-foreground mt-4 text-center leading-relaxed">
Our Enterprise License is great for large organizations looking to switch to Documenso for all
their signing needs. It's availible for our cloud offering as well as self-hosted setups and
offers a wide range of compliance and Adminstration Features.
<Trans>
Our Enterprise License is great for large organizations looking to switch to Documenso for
all their signing needs. It's available for our cloud offering as well as self-hosted
setups and offers a wide range of compliance and Adminstration Features.
</Trans>
</p>
<div className="mt-4 flex justify-center">
@ -28,7 +31,9 @@ export const Enterprise = () => {
className="mt-6"
onClick={() => event('enterprise-contact')}
>
<Button className="rounded-full text-base">Contact Us</Button>
<Button className="rounded-full text-base">
<Trans>Contact Us</Trans>
</Button>
</Link>
</div>
</div>

View File

@ -2,6 +2,8 @@ import type { HTMLAttributes } from 'react';
import Image from 'next/image';
import { Trans } from '@lingui/macro';
import backgroundPattern from '@documenso/assets/images/background-pattern.png';
import cardBeautifulFigure from '@documenso/assets/images/card-beautiful-figure.png';
import cardFastFigure from '@documenso/assets/images/card-fast-figure.png';
@ -25,17 +27,23 @@ export const FasterSmarterBeautifulBento = ({
/>
</div>
<h2 className="px-0 text-[22px] font-semibold md:px-12 md:text-4xl lg:px-24">
A 10x better signing experience.
<span className="block md:mt-0">Faster, smarter and more beautiful.</span>
<Trans>A 10x better signing experience.</Trans>
<span className="block md:mt-0">
<Trans>Faster, smarter and more beautiful.</Trans>
</span>
</h2>
<div className="mt-6 grid grid-cols-2 gap-8 md:mt-8">
<Card className="col-span-2" degrees={45} gradient>
<CardContent className="grid grid-cols-12 gap-8 overflow-hidden p-6 lg:aspect-[2.5/1]">
<p className="text-foreground/80 col-span-12 leading-relaxed lg:col-span-6">
<strong className="block">Fast.</strong>
When it comes to sending or receiving a contract, you can count on lightning-fast
speeds.
<strong className="block">
<Trans>Fast.</Trans>
</strong>
<Trans>
When it comes to sending or receiving a contract, you can count on lightning-fast
speeds.
</Trans>
</p>
<div className="col-span-12 -my-6 -mr-6 flex items-end justify-end pt-12 lg:col-span-6">
@ -51,9 +59,13 @@ export const FasterSmarterBeautifulBento = ({
<Card className="col-span-2 lg:col-span-1" spotlight>
<CardContent className="grid grid-cols-1 gap-8 p-6">
<p className="text-foreground/80 leading-relaxed">
<strong className="block">Beautiful.</strong>
Because signing should be celebrated. Thats why we care about the smallest detail in
our product.
<strong className="block">
<Trans>Beautiful.</Trans>
</strong>
<Trans>
Because signing should be celebrated. Thats why we care about the smallest detail
in our product.
</Trans>
</p>
<div className="flex items-center justify-center p-8">
@ -69,8 +81,12 @@ export const FasterSmarterBeautifulBento = ({
<Card className="col-span-2 lg:col-span-1" spotlight>
<CardContent className="grid grid-cols-1 gap-8 p-6">
<p className="text-foreground/80 leading-relaxed">
<strong className="block">Smart.</strong>
Our custom templates come with smart rules that can help you save time and energy.
<strong className="block">
<Trans>Smart.</Trans>
</strong>
<Trans>
Our custom templates come with smart rules that can help you save time and energy.
</Trans>
</p>
<div className="flex items-center justify-center p-8">

View File

@ -5,6 +5,8 @@ import type { HTMLAttributes } from 'react';
import Image from 'next/image';
import Link from 'next/link';
import { msg } from '@lingui/macro';
import { useLingui } from '@lingui/react';
import { FaXTwitter } from 'react-icons/fa6';
import { LiaDiscord } from 'react-icons/lia';
import { LuGithub } from 'react-icons/lu';
@ -13,6 +15,8 @@ import LogoImage from '@documenso/assets/logo.png';
import { cn } from '@documenso/ui/lib/utils';
import { ThemeSwitcher } from '@documenso/ui/primitives/theme-switcher';
import { I18nSwitcher } from '~/components/(marketing)/i18n-switcher';
// import { StatusWidgetContainer } from './status-widget-container';
export type FooterProps = HTMLAttributes<HTMLDivElement>;
@ -24,22 +28,24 @@ const SOCIAL_LINKS = [
];
const FOOTER_LINKS = [
{ href: '/pricing', text: 'Pricing' },
{ href: '/pricing', text: msg`Pricing` },
{ href: '/singleplayer', text: 'Singleplayer' },
{ href: 'https://docs.documenso.com', text: 'Documentation', target: '_blank' },
{ href: 'mailto:support@documenso.com', text: 'Support', target: '_blank' },
{ href: '/blog', text: 'Blog' },
{ href: '/changelog', text: 'Changelog' },
{ href: '/open', text: 'Open Startup' },
{ href: '/design-system', text: 'Design' },
{ href: 'https://shop.documenso.com', text: 'Shop', target: '_blank' },
{ href: 'https://status.documenso.com', text: 'Status', target: '_blank' },
{ href: '/oss-friends', text: 'OSS Friends' },
{ href: '/careers', text: 'Careers' },
{ href: '/privacy', text: 'Privacy' },
{ href: 'https://docs.documenso.com', text: msg`Documentation`, target: '_blank' },
{ href: 'mailto:support@documenso.com', text: msg`Support`, target: '_blank' },
{ href: '/blog', text: msg`Blog` },
{ href: '/changelog', text: msg`Changelog` },
{ href: '/open', text: msg`Open Startup` },
{ href: '/design-system', text: msg`Design` },
{ href: 'https://shop.documenso.com', text: msg`Shop`, target: '_blank' },
{ href: 'https://status.documenso.com', text: msg`Status`, target: '_blank' },
{ href: '/oss-friends', text: msg`OSS Friends` },
{ href: '/careers', text: msg`Careers` },
{ href: '/privacy', text: msg`Privacy` },
];
export const Footer = ({ className, ...props }: FooterProps) => {
const { _ } = useLingui();
return (
<div className={cn('border-t py-12', className)} {...props}>
<div className="mx-auto flex w-full max-w-screen-xl flex-wrap items-start justify-between gap-8 px-8">
@ -80,7 +86,7 @@ export const Footer = ({ className, ...props }: FooterProps) => {
target={link.target}
className="text-muted-foreground hover:text-muted-foreground/80 flex-shrink-0 break-words text-sm"
>
{link.text}
{typeof link.text === 'string' ? link.text : _(link.text)}
</Link>
))}
</div>
@ -90,8 +96,12 @@ export const Footer = ({ className, ...props }: FooterProps) => {
© {new Date().getFullYear()} Documenso, Inc. All rights reserved.
</p>
<div className="flex flex-wrap">
<ThemeSwitcher />
<div className="flex flex-row-reverse items-center sm:flex-row">
<I18nSwitcher className="text-muted-foreground ml-2 rounded-full font-normal sm:mr-2" />
<div className="flex flex-wrap">
<ThemeSwitcher />
</div>
</div>
</div>
</div>

View File

@ -6,8 +6,9 @@ import { useState } from 'react';
import Image from 'next/image';
import Link from 'next/link';
import { Trans } from '@lingui/macro';
import LogoImage from '@documenso/assets/logo.png';
import { useFeatureFlags } from '@documenso/lib/client-only/providers/feature-flag';
import { cn } from '@documenso/ui/lib/utils';
import { Button } from '@documenso/ui/primitives/button';
@ -19,10 +20,6 @@ export type HeaderProps = HTMLAttributes<HTMLElement>;
export const Header = ({ className, ...props }: HeaderProps) => {
const [isHamburgerMenuOpen, setIsHamburgerMenuOpen] = useState(false);
const { getFlag } = useFeatureFlags();
const isSinglePlayerModeMarketingEnabled = getFlag('marketing_header_single_player_mode');
return (
<header className={cn('flex items-center justify-between', className)} {...props}>
<div className="flex items-center space-x-4">
@ -35,15 +32,6 @@ export const Header = ({ className, ...props }: HeaderProps) => {
height={25}
/>
</Link>
{isSinglePlayerModeMarketingEnabled && (
<Link
href="/singleplayer"
className="bg-primary dark:text-background rounded-full px-2 py-1 text-xs font-semibold sm:px-3"
>
Try now!
</Link>
)}
</div>
<div className="hidden items-center gap-x-6 md:flex">
@ -51,7 +39,7 @@ export const Header = ({ className, ...props }: HeaderProps) => {
href="/pricing"
className="text-muted-foreground hover:text-muted-foreground/80 text-sm font-semibold"
>
Pricing
<Trans>Pricing</Trans>
</Link>
<Link
@ -66,14 +54,14 @@ export const Header = ({ className, ...props }: HeaderProps) => {
href="/blog"
className="text-muted-foreground hover:text-muted-foreground/80 text-sm font-semibold"
>
Blog
<Trans>Blog</Trans>
</Link>
<Link
href="/open"
className="text-muted-foreground hover:text-muted-foreground/80 text-sm font-semibold"
>
Open Startup
<Trans>Open Startup</Trans>
</Link>
<Link
@ -81,12 +69,12 @@ export const Header = ({ className, ...props }: HeaderProps) => {
target="_blank"
className="text-muted-foreground hover:text-muted-foreground/80 text-sm font-semibold"
>
Sign in
<Trans>Sign in</Trans>
</Link>
<Button className="rounded-full" size="sm" asChild>
<Link href="https://app.documenso.com/signup?utm_source=marketing-header" target="_blank">
Sign up
<Trans>Sign up</Trans>
</Link>
</Button>
</div>

View File

@ -3,6 +3,7 @@
import Image from 'next/image';
import Link from 'next/link';
import { Trans } from '@lingui/macro';
import type { Variants } from 'framer-motion';
import { motion } from 'framer-motion';
import { usePlausible } from 'next-plausible';
@ -96,8 +97,11 @@ export const Hero = ({ className, ...props }: HeroProps) => {
animate="animate"
className="text-center text-4xl font-bold leading-tight tracking-tight md:text-[48px] lg:text-[64px]"
>
Document signing,
<span className="block" /> finally open source.
<Trans>
Document signing,
<span className="block" />
finally open source.
</Trans>
</motion.h2>
<motion.div
@ -112,39 +116,21 @@ export const Hero = ({ className, ...props }: HeroProps) => {
variant="outline"
className="rounded-full bg-transparent backdrop-blur-sm"
>
Try our Free Plan
<Trans>Try our Free Plan</Trans>
<span className="bg-primary dark:text-background -mr-2.5 ml-2.5 rounded-full px-2 py-1.5 text-xs font-medium">
No Credit Card required
<Trans>No Credit Card required</Trans>
</span>
</Button>
</Link>
<Link href="https://github.com/documenso/documenso" onClick={() => event('view-github')}>
<Button variant="outline" className="rounded-full bg-transparent backdrop-blur-sm">
<LuGithub className="mr-2 h-5 w-5" />
Star on GitHub
<Trans>Star on GitHub</Trans>
</Button>
</Link>
</motion.div>
{match(heroMarketingCTA)
.with('spm', () => (
<motion.div
variants={HeroTitleVariants}
initial="initial"
animate="animate"
className="border-primary bg-background hover:bg-muted mx-auto mt-8 w-60 rounded-xl border transition-colors duration-300"
>
<Link href="/singleplayer" className="block px-4 py-2 text-center">
<h2 className="text-muted-foreground text-xs font-semibold">
Introducing Single Player Mode
</h2>
<h1 className="text-foreground mt-1.5 font-medium leading-5">
Self sign for free!
</h1>
</Link>
</motion.div>
))
.with('productHunt', () => (
<motion.div
variants={HeroTitleVariants}

View File

@ -0,0 +1,71 @@
import { useState } from 'react';
import { msg } from '@lingui/macro';
import { useLingui } from '@lingui/react';
import { CheckIcon } from 'lucide-react';
import { LuLanguages } from 'react-icons/lu';
import { SUPPORTED_LANGUAGES } from '@documenso/lib/constants/i18n';
import { switchI18NLanguage } from '@documenso/lib/server-only/i18n/switch-i18n-language';
import { dynamicActivate } from '@documenso/lib/utils/i18n';
import { cn } from '@documenso/ui/lib/utils';
import { Button } from '@documenso/ui/primitives/button';
import {
CommandDialog,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
} from '@documenso/ui/primitives/command';
type I18nSwitcherProps = {
className?: string;
};
export const I18nSwitcher = ({ className }: I18nSwitcherProps) => {
const { i18n, _ } = useLingui();
const [open, setOpen] = useState(false);
const [value, setValue] = useState(i18n.locale);
const setLanguage = async (lang: string) => {
setValue(lang);
setOpen(false);
await dynamicActivate(i18n, lang);
await switchI18NLanguage(lang);
};
return (
<>
<Button className={className} variant="ghost" onClick={() => setOpen(true)}>
<LuLanguages className="mr-1.5 h-4 w-4" />
{SUPPORTED_LANGUAGES[value]?.full || i18n.locale}
</Button>
<CommandDialog open={open} onOpenChange={setOpen}>
<CommandInput placeholder={_(msg`Search languages...`)} />
<CommandList>
<CommandGroup>
{Object.values(SUPPORTED_LANGUAGES).map((language) => (
<CommandItem
key={language.short}
value={language.full}
onSelect={async () => setLanguage(language.short)}
>
<CheckIcon
className={cn(
'mr-2 h-4 w-4',
value === language.short ? 'opacity-100' : 'opacity-0',
)}
/>
{SUPPORTED_LANGUAGES[language.short].full}
</CommandItem>
))}
</CommandGroup>
</CommandList>
</CommandDialog>
</>
);
};

View File

@ -3,6 +3,8 @@
import Image from 'next/image';
import Link from 'next/link';
import { msg } from '@lingui/macro';
import { useLingui } from '@lingui/react';
import { motion, useReducedMotion } from 'framer-motion';
import { FaXTwitter } from 'react-icons/fa6';
import { LiaDiscord } from 'react-icons/lia';
@ -19,11 +21,11 @@ export type MobileNavigationProps = {
export const MENU_NAVIGATION_LINKS = [
{
href: '/pricing',
text: 'Pricing',
text: msg`Pricing`,
},
{
href: 'https://documen.so/docs-nav',
text: 'Documentation',
text: msg`Documentation`,
},
{
href: '/singleplayer',
@ -31,36 +33,38 @@ export const MENU_NAVIGATION_LINKS = [
},
{
href: '/blog',
text: 'Blog',
text: msg`Blog`,
},
{
href: '/open',
text: 'Open Startup',
text: msg`Open Startup`,
},
{
href: 'https://status.documenso.com',
text: 'Status',
text: msg`Status`,
},
{
href: 'mailto:support@documenso.com',
text: 'Support',
text: msg`Support`,
target: '_blank',
},
{
href: '/privacy',
text: 'Privacy',
text: msg`Privacy`,
},
{
href: 'https://app.documenso.com/signup?utm_source=marketing-header',
text: 'Sign up',
text: msg`Sign up`,
},
{
href: 'https://app.documenso.com/signin?utm_source=marketing-header',
text: 'Sign in',
text: msg`Sign in`,
},
];
export const MobileNavigation = ({ isMenuOpen, onMenuOpenChange }: MobileNavigationProps) => {
const { _ } = useLingui();
const shouldReduceMotion = useReducedMotion();
const handleMenuItemClick = () => {
@ -112,7 +116,7 @@ export const MobileNavigation = ({ isMenuOpen, onMenuOpenChange }: MobileNavigat
onClick={() => handleMenuItemClick()}
target={target}
>
{text}
{typeof text === 'string' ? text : _(text)}
</Link>
</motion.div>
))}

View File

@ -2,6 +2,8 @@ import type { HTMLAttributes } from 'react';
import Image from 'next/image';
import { Trans } from '@lingui/macro';
import backgroundPattern from '@documenso/assets/images/background-pattern.png';
import cardBuildFigure from '@documenso/assets/images/card-build-figure.png';
import cardOpenFigure from '@documenso/assets/images/card-open-figure.png';
@ -22,17 +24,23 @@ export const OpenBuildTemplateBento = ({ className, ...props }: OpenBuildTemplat
/>
</div>
<h2 className="px-0 text-[22px] font-semibold md:px-12 md:text-4xl lg:px-24">
Truly your own.
<span className="block md:mt-0">Customise and expand.</span>
<Trans>Truly your own.</Trans>
<span className="block md:mt-0">
<Trans>Customise and expand.</Trans>
</span>
</h2>
<div className="mt-6 grid grid-cols-2 gap-8 md:mt-8">
<Card className="col-span-2" degrees={45} gradient>
<CardContent className="grid grid-cols-12 gap-8 overflow-hidden p-6 lg:aspect-[2.5/1]">
<p className="text-foreground/80 col-span-12 leading-relaxed lg:col-span-6">
<strong className="block">Open Source or Hosted.</strong>
Its up to you. Either clone our repository or rely on our easy to use hosting
solution.
<strong className="block">
<Trans>Open Source or Hosted.</Trans>
</strong>
<Trans>
Its up to you. Either clone our repository or rely on our easy to use hosting
solution.
</Trans>
</p>
<div className="col-span-12 -my-6 -mr-6 flex items-end justify-end pt-12 lg:col-span-6">
@ -48,8 +56,10 @@ export const OpenBuildTemplateBento = ({ className, ...props }: OpenBuildTemplat
<Card className="col-span-2 lg:col-span-1" spotlight>
<CardContent className="grid grid-cols-1 gap-8 p-6">
<p className="text-foreground/80 leading-relaxed">
<strong className="block">Build on top.</strong>
Make it your own through advanced customization and adjustability.
<strong className="block">
<Trans>Build on top.</Trans>
</strong>
<Trans>Make it your own through advanced customization and adjustability.</Trans>
</p>
<div className="flex items-center justify-center p-8">
@ -65,9 +75,13 @@ export const OpenBuildTemplateBento = ({ className, ...props }: OpenBuildTemplat
<Card className="col-span-2 lg:col-span-1" spotlight>
<CardContent className="grid grid-cols-1 gap-8 p-6">
<p className="text-foreground/80 leading-relaxed">
<strong className="block">Template Store (Soon).</strong>
Choose a template from the community app store. Or submit your own template for others
to use.
<strong className="block">
<Trans>Template Store (Soon).</Trans>
</strong>
<Trans>
Choose a template from the community app store. Or submit your own template for
others to use.
</Trans>
</p>
<div className="flex items-center justify-center p-8">

View File

@ -5,6 +5,7 @@ import { useState } from 'react';
import Link from 'next/link';
import { Trans } from '@lingui/macro';
import { AnimatePresence, motion } from 'framer-motion';
import { usePlausible } from 'next-plausible';
@ -36,7 +37,7 @@ export const PricingTable = ({ className, ...props }: PricingTableProps) => {
)}
onClick={() => setPeriod('MONTHLY')}
>
Monthly
<Trans>Monthly</Trans>
{period === 'MONTHLY' && (
<motion.div
layoutId={SELECTED_PLAN_BAR_LAYOUT_ID}
@ -56,9 +57,9 @@ export const PricingTable = ({ className, ...props }: PricingTableProps) => {
)}
onClick={() => setPeriod('YEARLY')}
>
Yearly
<Trans>Yearly</Trans>
<div className="bg-muted text-foreground block rounded-full px-2 py-0.5 text-xs">
Save $60 or $120
<Trans>Save $60 or $120</Trans>
</div>
{period === 'YEARLY' && (
<motion.div
@ -75,11 +76,13 @@ export const PricingTable = ({ className, ...props }: PricingTableProps) => {
data-plan="free"
className="bg-background shadow-foreground/5 flex flex-col items-center justify-center rounded-lg border px-8 py-12 shadow-lg"
>
<p className="text-foreground text-4xl font-medium">Free</p>
<p className="text-foreground text-4xl font-medium">
<Trans>Free</Trans>
</p>
<p className="text-primary mt-2.5 text-xl font-medium">$0</p>
<p className="text-foreground mt-4 max-w-[30ch] text-center">
For small teams and individuals with basic needs.
<Trans>For small teams and individuals with basic needs.</Trans>
</p>
<Button className="rounded-full text-base" asChild>
@ -88,14 +91,20 @@ export const PricingTable = ({ className, ...props }: PricingTableProps) => {
target="_blank"
className="mt-6"
>
Signup Now
<Trans>Signup Now</Trans>
</Link>
</Button>
<div className="mt-8 flex w-full flex-col divide-y">
<p className="text-foreground py-4">5 standard documents per month</p>
<p className="text-foreground py-4">Up to 10 recipients per document</p>
<p className="text-foreground py-4">No credit card required</p>
<p className="text-foreground py-4">
<Trans>5 standard documents per month</Trans>
</p>
<p className="text-foreground py-4">
<Trans>Up to 10 recipients per document</Trans>
</p>
<p className="text-foreground py-4">
<Trans>No credit card required</Trans>
</p>
</div>
<div className="flex-1" />
@ -105,7 +114,9 @@ export const PricingTable = ({ className, ...props }: PricingTableProps) => {
data-plan="individual"
className="bg-background shadow-foreground/5 flex flex-col items-center justify-center rounded-lg border-2 px-8 py-12 shadow-[0px_0px_0px_4px_#E3E3E380]"
>
<p className="text-foreground text-4xl font-medium">Individual</p>
<p className="text-foreground text-4xl font-medium">
<Trans>Individual</Trans>
</p>
<div className="text-primary mt-2.5 text-xl font-medium">
<AnimatePresence mode="wait">
{period === 'MONTHLY' && <motion.div layoutId="pricing">$30</motion.div>}
@ -114,7 +125,7 @@ export const PricingTable = ({ className, ...props }: PricingTableProps) => {
</div>
<p className="text-foreground mt-4 max-w-[30ch] text-center">
Everything you need for a great signing experience.
<Trans>Everything you need for a great signing experience.</Trans>
</p>
<Button className="mt-6 rounded-full text-base" asChild>
@ -122,15 +133,23 @@ export const PricingTable = ({ className, ...props }: PricingTableProps) => {
href={`${NEXT_PUBLIC_WEBAPP_URL()}/signup?utm_source=pricing-individual-plan`}
target="_blank"
>
Signup Now
<Trans>Signup Now</Trans>
</Link>
</Button>
<div className="mt-8 flex w-full flex-col divide-y">
<p className="text-foreground py-4">Unlimited Documents per Month</p>
<p className="text-foreground py-4">API Access</p>
<p className="text-foreground py-4">Email and Discord Support</p>
<p className="text-foreground py-4">Premium Profile Name</p>
<p className="text-foreground py-4">
<Trans>Unlimited Documents per Month</Trans>
</p>
<p className="text-foreground py-4">
<Trans>API Access</Trans>
</p>
<p className="text-foreground py-4">
<Trans>Email and Discord Support</Trans>
</p>
<p className="text-foreground py-4">
<Trans>Premium Profile Name</Trans>
</p>
</div>
<div className="flex-1" />
</div>
@ -139,7 +158,9 @@ export const PricingTable = ({ className, ...props }: PricingTableProps) => {
data-plan="teams"
className="border-primary bg-background shadow-foreground/5 flex flex-col items-center justify-center rounded-lg border px-8 py-12 shadow-lg"
>
<p className="text-foreground text-4xl font-medium">Teams</p>
<p className="text-foreground text-4xl font-medium">
<Trans>Teams</Trans>
</p>
<div className="text-primary mt-2.5 text-xl font-medium">
<AnimatePresence mode="wait">
{period === 'MONTHLY' && <motion.div layoutId="pricingTeams">$50</motion.div>}
@ -148,7 +169,7 @@ export const PricingTable = ({ className, ...props }: PricingTableProps) => {
</div>
<p className="text-foreground mt-4 max-w-[30ch] text-center">
For companies looking to scale across multiple teams.
<Trans>For companies looking to scale across multiple teams.</Trans>
</p>
<Button className="mt-6 rounded-full text-base" asChild>
@ -156,18 +177,28 @@ export const PricingTable = ({ className, ...props }: PricingTableProps) => {
href={`${NEXT_PUBLIC_WEBAPP_URL()}/signup?utm_source=pricing-teams-plan`}
target="_blank"
>
Signup Now
<Trans>Signup Now</Trans>
</Link>
</Button>
<div className="mt-8 flex w-full flex-col divide-y">
<p className="text-foreground py-4">Unlimited Documents per Month</p>
<p className="text-foreground py-4">API Access</p>
<p className="text-foreground py-4">Email and Discord Support</p>
<p className="text-foreground py-4 font-medium">Team Inbox</p>
<p className="text-foreground py-4">5 Users Included</p>
<p className="text-foreground py-4">
Add More Users for {period === 'MONTHLY' ? '$10/ mo.' : '$96/ yr.'}
<Trans>Unlimited Documents per Month</Trans>
</p>
<p className="text-foreground py-4">
<Trans>API Access</Trans>
</p>
<p className="text-foreground py-4">
<Trans>Email and Discord Support</Trans>
</p>
<p className="text-foreground py-4 font-medium">
<Trans>Team Inbox</Trans>
</p>
<p className="text-foreground py-4">
<Trans>5 Users Included</Trans>
</p>
<p className="text-foreground py-4">
<Trans>Add More Users for {period === 'MONTHLY' ? '$10/ mo.' : '$96/ yr.'}</Trans>
</p>
</div>
</div>

View File

@ -2,6 +2,8 @@ import type { HTMLAttributes } from 'react';
import Image from 'next/image';
import { Trans } from '@lingui/macro';
import backgroundPattern from '@documenso/assets/images/background-pattern.png';
import cardConnectionsFigure from '@documenso/assets/images/card-connections-figure.png';
import cardPaidFigure from '@documenso/assets/images/card-paid-figure.png';
@ -26,16 +28,20 @@ export const ShareConnectPaidWidgetBento = ({
/>
</div>
<h2 className="px-0 text-[22px] font-semibold md:px-12 md:text-4xl lg:px-24">
Integrates with all your favourite tools.
<span className="block md:mt-0">Send, connect, receive and embed everywhere.</span>
<Trans>Integrates with all your favourite tools.</Trans>
<span className="block md:mt-0">
<Trans>Send, connect, receive and embed everywhere.</Trans>
</span>
</h2>
<div className="mt-6 grid grid-cols-2 gap-8 md:mt-8">
<Card className="col-span-2 lg:col-span-1" degrees={120} gradient>
<CardContent className="grid grid-cols-1 gap-8 p-6">
<p className="text-foreground/80 leading-relaxed">
<strong className="block">Easy Sharing (Soon).</strong>
Receive your personal link to share with everyone you care about.
<strong className="block">
<Trans>Easy Sharing (Soon).</Trans>
</strong>
<Trans>Receive your personal link to share with everyone you care about.</Trans>
</p>
<div className="flex items-center justify-center p-8">
@ -51,9 +57,13 @@ export const ShareConnectPaidWidgetBento = ({
<Card className="col-span-2 lg:col-span-1" spotlight>
<CardContent className="grid grid-cols-1 gap-8 p-6">
<p className="text-foreground/80 leading-relaxed">
<strong className="block">Connections</strong>
Create connections and automations with Zapier and more to integrate with your
favorite tools.
<strong className="block">
<Trans>Connections</Trans>
</strong>
<Trans>
Create connections and automations with Zapier and more to integrate with your
favorite tools.
</Trans>
</p>
<div className="flex items-center justify-center p-8">
@ -69,8 +79,12 @@ export const ShareConnectPaidWidgetBento = ({
<Card className="col-span-2 lg:col-span-1" spotlight>
<CardContent className="grid grid-cols-1 gap-8 p-6">
<p className="text-foreground/80 leading-relaxed">
<strong className="block">Get paid (Soon).</strong>
Integrated payments with Stripe so you dont have to worry about getting paid.
<strong className="block">
<Trans>Get paid (Soon).</Trans>
</strong>
<Trans>
Integrated payments with Stripe so you dont have to worry about getting paid.
</Trans>
</p>
<div className="flex items-center justify-center p-8">
@ -86,9 +100,13 @@ export const ShareConnectPaidWidgetBento = ({
<Card className="col-span-2 lg:col-span-1" spotlight>
<CardContent className="grid grid-cols-1 gap-8 p-6">
<p className="text-foreground/80 leading-relaxed">
<strong className="block">React Widget (Soon).</strong>
Easily embed Documenso into your product. Simply copy and paste our react widget into
your application.
<strong className="block">
<Trans>React Widget (Soon).</Trans>
</strong>
<Trans>
Easily embed Documenso into your product. Simply copy and paste our react widget
into your application.
</Trans>
</p>
<div className="flex items-center justify-center p-8">