Skip to main content

About

Documenso uses the following stack to handle translations:
  • Lingui - React i10n library
  • Crowdin - Handles syncing translations
  • OpenAI - Provides AI translations
Additional reading can be found in the Lingui documentation.

Requirements

You must insert setupI18nSSR() when creating any of the following files:
  • Server layout.tsx
  • Server page.tsx
  • Server loading.tsx
Server meaning it does not have 'use client' in it.
Additional information can be found here.

Quick guide

If you require more in-depth information, please see the Lingui documentation.

HTML

Wrap all text to translate in <Trans></Trans> tags exported from @lingui/macro (not @lingui/react).
For text that is broken into elements, but represent a whole sentence, you must wrap it in a Trans tag so ensure the full message is extracted correctly.

Constants outside of react components

Plurals

Lingui provides a Plural component to make it easy. See full documentation here.

Dates

Lingui provides a DateTime instance with the configured locale.

Server components

Note that the i18n instance is coming from setupI18nSSR.

Client components

Note that the i18n instance is coming from the import.